×
[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
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度ほど高く表示されている、、