File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 33from micropython import const
44
55class ModulinoButtonsLED ():
6+ """
7+ Class to interact with the LEDs of the Modulino Buttons.
8+ """
9+
610 def __init__ (self , buttons ):
711 self ._value = 0
812 self ._buttons = buttons
913
1014 def on (self ):
15+ """ Turns the LED on. """
1116 self .value = 1
1217
1318 def off (self ):
19+ """ Turns the LED off. """
1420 self .value = 0
1521
1622 @property
1723 def value (self ):
24+ """ Returns the value of the LED (1 for on, 0 for off). """
1825 return self ._value
1926
2027 @value .setter
2128 def value (self , value ):
29+ """
30+ Sets the value of the LED (1 for on, 0 for off).
31+ Calling this method will update the physical status of the LED immediately.
32+ """
2233 self ._value = value
2334 self ._buttons ._update_leds ()
2435
You can’t perform that action at this time.
0 commit comments