예제 #1
0
# 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
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
# 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
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)