featherwing_sevensegment_simpletest.py
1 """This example changes the fill, brightness, blink rates, 2 shows number and text printing, displays a counter 3 and then shows off the new marquee features.""" 4 5 from time import sleep 6 from adafruit_featherwing import sevensegment_featherwing 7 8 display = sevensegment_featherwing.SevenSegmentFeatherWing() 9 10 # Fill and empty all segments 11 for count in range(0, 3): 12 display.fill(True) 13 sleep(0.5) 14 display.fill(False) 15 sleep(0.5) 16 17 # Display a number and text 18 display.print(1234) 19 sleep(1) 20 display.print("FEED") 21 22 # Change brightness 23 for brightness in range(0, 16): 24 display.brightness = brightness 25 sleep(0.1) 26 27 # Change blink rate 28 for blink_rate in range(3, 0, -1): 29 display.blink_rate = blink_rate 30 sleep(4) 31 display.blink_rate = 0 32 33 # Show a counter using decimals 34 count = 975.0 35 while count < 1025: 36 count += 1 37 display.print(count) 38 sleep(0.1) 39 40 # Display a Time 41 hour = 12 42 for minute in range(15, 26): 43 display.print("{}:{}".format(hour, minute)) 44 sleep(1) 45 46 # Show the Marquee 47 display.marquee("Deadbeef 192.168.100.102... ", 0.2)