File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 6969class SevenSegment (HT16K33 .HT16K33 ):
7070 """Seven segment LED backpack display."""
7171
72- def __init__ (self , ** kwargs ):
72+ def __init__ (self , invert = False , ** kwargs ):
7373 """Initialize display. All arguments will be passed to the HT16K33 class
7474 initializer, including optional I2C address and bus number parameters.
7575 """
7676 super (SevenSegment , self ).__init__ (** kwargs )
77- self .invert = True
77+ self .invert = invert
7878
7979 def set_invert (self , _invert ):
8080 """Set whether the display is upside-down or not.
Original file line number Diff line number Diff line change 7272 display .print_hex (i )
7373 display .set_colon (colon )
7474 display .write_display ()
75- time .sleep (0.5 )
75+ time .sleep (0.25 )
76+ # Run through hex digits with an inverted (flipped upside down)
77+ # display.
78+ display .set_invert (True )
79+ for i in range (0xFF ):
80+ display .clear ()
81+ display .print_hex (i )
82+ display .set_colon (colon )
83+ display .write_display ()
84+ time .sleep (0.25 )
85+ display .set_invert (False )
7686 # Flip colon on or off.
7787 colon = not colon
7888
You can’t perform that action at this time.
0 commit comments