Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from Adafruit_LED_Backpack import SevenSegment
- # ===========================================================================
- # test display segments of 7-segment display
- # ===========================================================================
- segment = SevenSegment.SevenSegment(address=0x70)
- # Initialize the display. Must be called once before using the display.
- segment.begin()
- # Continually update the time on a 4 char, 7-segment display
- while(True):
- # turn each one on for a brief flash
- for pos in range(4):
- for seg in range(8):
- segment.clear()
- segment.set_led((pos*16)+seg, True)
- segment.write_display()
- time.sleep(0.5)
- # turn them all on for a long pulse
- segment.clear()
- for i in range(128):
- segment.set_led(i,True)
- segment.write_display()
- time.sleep(0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement