コード例 #1
0
ファイル: show_temp.py プロジェクト: sefiamor/sensehat
# Shows temp (rounded to nearest degree) on SenseHat LEDs
# Using small 3x5 characters, so we can fit two digits without scrolling
# TBD: we still have 3 lines free on the LED matrix:
# We could fit a little 'degrees' symbol if digits were shifted down.....

from smallhex import to_dec_chars
from sense_hat import SenseHat
from time import sleep

sense = SenseHat()
sense.set_rotation(180)
sense.low_light = True
while True:
    temp = int(round(sense.get_temperature()))
    sense.set_pixels(to_dec_chars(temp))
    sleep(5)
コード例 #2
0
ファイル: counter_test.py プロジェクト: sefiamor/sensehat
from smallhex import to_hex_chars, to_dec_chars, two_chars
from time import sleep
from sense_hat import SenseHat

sense = SenseHat()
sense.set_pixels(two_chars("Hi"))
for rot in range(0, 360, 90):
    sense.set_rotation(rot)
    sleep(0.25)

sense.set_rotation(180)

for count in range(256):
    sense.set_pixels(to_hex_chars(count))
    sleep(0.1)
for count in range(100):
    sense.set_pixels(to_dec_chars(count))
    sleep(0.1)
コード例 #3
0
ファイル: show_temp.py プロジェクト: midijohnny/sensehat
# Shows temp (rounded to nearest degree) on SenseHat LEDs
# Using small 3x5 characters, so we can fit two digits without scrolling
# TBD: we still have 3 lines free on the LED matrix: 
# We could fit a little 'degrees' symbol if digits were shifted down.....

from smallhex import to_dec_chars
from sense_hat import SenseHat
from time import sleep

sense=SenseHat()
sense.set_rotation(180)
sense.low_light = True
while True:
	temp = int( round( sense.get_temperature() ) )
	sense.set_pixels( to_dec_chars( temp ) )
	sleep(5)

コード例 #4
0
ファイル: counter_test.py プロジェクト: midijohnny/sensehat
from smallhex import to_hex_chars, to_dec_chars, two_chars
from time import sleep
from sense_hat import SenseHat

sense=SenseHat()
sense.set_pixels( two_chars("Hi") )
for rot in range(0,360,90):
	sense.set_rotation(rot)
	sleep(0.25)

sense.set_rotation(180)

for count in range(256):
	sense.set_pixels( to_hex_chars(count) )
	sleep(0.1)
for count in range(100):
	sense.set_pixels( to_dec_chars(count) )
	sleep(0.1)