忍者ブログ
[265]  [264]  [263]  [262]  [261]  [260]  [259]  [258]  [257]  [256]  [255
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

まずはライブラリのインストール

http://pythonhosted.org/sense-hat/の説明にしたがって

sudo apt-get update
sudo apt-get install sense-hat
sudo pip-
3.2 install pillow

これで準備完了

温度と湿度をマトリックスLEDに表示する

from sense_hat import SenseHat
try:
   while True:
     sense = SenseHat() #get temp
     temp = sense.get_temperature()
     temp = round(temp,1)
     print "Temp:" + str(temp)
     hub = sense.get_humidity()
     hub = round(hub,1)
     sense.show_message("T:" + str(temp),scroll_speed = 0.2)
     sense.show_message("H:" + str(hub),scroll_speed = 0.2)
except KeyboardInterrupt:
 sense.clear()
 sense.set_rotation(0)
 sense.show_message("good by")

いいんだけど温度が3度ほど高く表示されている、、

拍手

PR
カレンダー
04 2025/05 06
S M T W T F S
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
フリーエリア
最新CM
[03/10 DORA]
最新TB
プロフィール
HN:
dorabu
性別:
非公開
バーコード
ブログ内検索
P R
忍者画像RSS
Copyright © ドラブーのアンドロイドとIoTなブログ All rights reserved. / Template by 四季. / Material by てんせん.

忍者ブログ [PR]