4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!
-
Upload
akira-ouchi -
Category
Self Improvement
-
view
3.712 -
download
0
description
Transcript of 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!
![Page 1: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/1.jpg)
4ドル弱で遊べる LCDモジュールを Raspberry Piで楽しもう!
Ejectコマンドユーザー会/ Japanese Raspberry Pi Users Group あっきぃ ( @Akkieso? ) 2014/3/22 OSC2014 Hamanako
![Page 2: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/2.jpg)
✌(‘ω’)✌ . \__/ 人 人
![Page 3: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/3.jpg)
風邪ひきなう
![Page 4: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/4.jpg)
昨日 家で一日
寝て
![Page 5: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/5.jpg)
今朝の新幹線グリーン車で
きますた
![Page 6: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/6.jpg)
( ˘ਊ˘)
O(でもちょっと腹減ってきた) o ・
![Page 7: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/7.jpg)
今日のLTは Ejectか?
Raspberry Piか?
![Page 8: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/8.jpg)
Raspberry Piだ
![Page 9: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/9.jpg)
多分
![Page 10: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/10.jpg)
Raspberry Piだ
![Page 11: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/11.jpg)
☝ ՞ _人人人人人_ > ( ) < ☞  ̄Y^Y^YY^Y^Y ̄ ՞ ਊ
![Page 12: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/12.jpg)
4ドル弱で遊べる LCDモジュールを Raspberry Piで楽しもう!
Ejectコマンドユーザー会/ Japanese Raspberry Pi Users Group あっきぃ ( @Akkieso? ) 2014/3/22 OSC2014 Hamanako
![Page 13: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/13.jpg)
自己紹介
• あっきぃともうします • 北海道根室市出身
• 通称Ejectおじさん
• あっきぃ か Eject でググって
• いまからLTが終わるまで@Akkieso?をふぁぼろう!!
![Page 14: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/14.jpg)
Ejectコマンドユーザー会とは
• CD-‐ROMドライブを • リモートからEjectコマンドでトレイ開閉させて
• トレイに色んなことをさせる工作を作って
• 使う、ユーザーの集いです。
• Ejectコマンドユーザー会のサイトにアクセス hUp://eject.kokuda.org/ or Eject で検索
• Google Groupsへの入会お待ちしています
![Page 15: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/15.jpg)
トレイに色んなことをさせる工作
• ハムスターにエサをあげる • エアコンの電源を操作する
• AC電源を操作する
• 除夜の鐘をつく – 昨年末もやりました
![Page 16: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/16.jpg)
Japanese Raspberry Pi Users Groupとは
• ラズベリーパイ財団が英国で開発した、ARMプロセッサ搭載のシングルボードコンピュータRaspberry Piで遊ぶユーザー会
• ユルく楽しくをモットーに活動ちゅう
• 不定期的にRaspberry JAMと言うあつまりを 開催(次回は4/12に東京で)
• raspi.jpをみてね
![Page 17: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/17.jpg)
本題
![Page 18: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/18.jpg)
ウェアラブルEject
• 去年の浜松で「頭にCD-‐ROMドライブを載せてウェラブルEjectって言えば良くね!」といった
• その後Big Raspberry JAMというイベントで かぶってたらRaspberry Pi公式サイトに載った
• 専用ヘルメットを開発
![Page 19: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/19.jpg)
※Raspberry Pi公式サイトです
http://www.raspberrypi.org/archives/4824
![Page 20: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/20.jpg)
ウェアラブルEjectヘルメット
• Amazonで買ったヘルメットに、自転車のゴムひもでCD-‐ROMドライブを固定したもの
• RasPiとバッテリーも搭載
• RasPiでTwiUerを監視して、ふぁぼとかメンションがきたらEject
• (Ejectトリガーのデモ)
![Page 21: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/21.jpg)
しかし、重かった。
• ヘルメットは1kg弱 • これのせいかどうかは不明ながら、肩こりと
か首の痛みとかが悪化する – しかし、PCとスマホのやりすぎによるストレート
ネックっぽい、職業病か( ´ ՞ ‸ ՞)
• ちょっとこれ以上かぶるの無理っぽそう
• ネタのために命を削るの良くない
![Page 22: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/22.jpg)
ところで
• 先月のOSC2014 Tokyo/Springから、ヘルメットに新機能を追加
• 低価格LCDモジュール「Nokia 5110 LCD module」を使った通知システム
• 誰がふぁぼったのかを可視化
• 今日はこれの紹介
![Page 23: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/23.jpg)
こいつはなにものだ
• 84×48ドットのLCD • Nokia5110と言うケータイで
使われていたLCDの再生品
• 文字表示・図形描画とかが できる
• バックライトの照度調整も できる(PWM制御らしい)
• これが4ドル弱で遊べる
![Page 24: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/24.jpg)
用意するもの
• Raspberry Pi • Nokia 5110 LCD module
• ジャンパ ケーブル(8本分) – つなぎ方によってオス-‐メス orメス-‐メス
• Pythonライブラリ – hUps://github.com/XavierBerger/pcd8544
![Page 25: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/25.jpg)
Nokia 5110 LCD moduleの調達
• 基本的に海外から輸入 • dx.com(3.95ドルから)
– hUp://dx.com/p/replacement-‐1-‐6-‐lcd-‐screen-‐with-‐blue-‐backlight-‐for-‐nokia-‐5110-‐blue-‐145860
• eBay(207円?から) – hUp://www.ebay.com/sch/items/__Nokia+5110
• 私はdx.comから購入(2週間くらいかかる) – ケーブルもdx.comで買える – hUp://dx.com/p/30cm-‐breadboard-‐wires-‐for-‐electronic-‐diy-‐40-‐cable-‐pack-‐80207
![Page 26: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/26.jpg)
接続とライブラリのインストール
• ライブラリのページに解説があるのでその通りにやるとできる
• hUps://github.com/XavierBerger/pcd8544
• 準備できたらexamplesディレクトリのサンプルを動かしてみよう!
• テキスト表示の例 – lcd.init() lcd.backlight(ON) lcd.text(“Hello! ;-‐)”)
![Page 27: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/27.jpg)
私製ふぁぼ・IP通知スクリプト
• TwiUerでふぁぼられたりメンションが送られたらEjectするスクリプト(Pythonのtweepyを使用)
• これに、先ほどのサンプルから拾ったコードを加える – 誰からふぁぼやメンションが送られたかを表示
– 自分用に、IPアドレスを表示するためのコマンドを用意
![Page 28: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/28.jpg)
こんな感じで動く
• ふぁぼられたとき – アカウント名を出す
• IP通知を要求した時 – 自分に対してIPと言う
文字列を含めた メンションを送る
![Page 29: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/29.jpg)
スクリプトは公開しています
• ダウンロードはこちら – hUps://gist.github.com/Akkieso?/9203410
• (☝ ՞ਊ ՞)☝の表示テストはこちら – hUp://akkieso?.hatenablog.jp/entry/20140225/1393322112
– hUps://gist.github.com/Akkieso?/9206874
• あそんでみてね(なげやり)
![Page 30: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/30.jpg)
どうです、楽しそうでしょう?
• いますぐRaspberry PiとNokia 5110 LCD moduleをポチって工作をはじめよう!
• Raspberry Piはほかにも色んな周辺機器が登場しているのでいろいろあそべる!
• PiTFTとかPiTFTとか PiTFTとか
![Page 31: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/31.jpg)
こっちが見たかった?
• PiTFTでググっておくれ • タッチパネル付き320x240ディスプレイ
• たのしいよ
• 懇親会でデモ できます
• ゆるせ✌(’ω’)✌
![Page 32: 4ドル弱で遊べるLCDモジュールをRaspberry Piで楽しもう!](https://reader034.fdocuments.in/reader034/viewer/2022051400/556156c9d8b42a857d8b537c/html5/thumbnails/32.jpg)
おわり