@@ -25,14 +25,14 @@ class Bicolor24(HT16K33):
25
25
LED_GREEN = 2
26
26
LED_YELLOW = 3
27
27
28
- def __getitem__ (self , key ) :
28
+ def __getitem__ (self , key : int ) -> int :
29
29
# map to HT16K33 row (x) and column (y), see schematic
30
30
x = key % 4 + 4 * (key // 12 )
31
31
y = key // 4 - 3 * (key // 12 )
32
32
# construct the color value and return it
33
33
return self ._pixel (x , y ) | self ._pixel (x + 8 , y ) << 1
34
34
35
- def __setitem__ (self , key , value ) :
35
+ def __setitem__ (self , key : int , value : int ) -> None :
36
36
# map to HT16K33 row (x) and column (y), see schematic
37
37
x = key % 4 + 4 * (key // 12 )
38
38
y = key // 4 - 3 * (key // 12 )
@@ -41,10 +41,12 @@ def __setitem__(self, key, value):
41
41
# conditionally turn on green LED
42
42
self ._pixel (x + 8 , y , value >> 1 )
43
43
44
- def fill (self , color ):
44
+ def fill (self , color : int ) -> None : # TODO: finish annotation
45
45
"""Fill the whole display with the given color.
46
46
47
- :param bool color: Whether to fill the display
47
+ :param int color: Whether to fill the display, where 0 is no
48
+ color, 1 is red, 2 is green, and 3 is yellow (red +
49
+ green)
48
50
"""
49
51
50
52
what_it_was = self .auto_write
0 commit comments