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 3
3
from micropython import const
4
4
5
5
class ModulinoButtonsLED ():
6
+ """
7
+ Class to interact with the LEDs of the Modulino Buttons.
8
+ """
9
+
6
10
def __init__ (self , buttons ):
7
11
self ._value = 0
8
12
self ._buttons = buttons
9
13
10
14
def on (self ):
15
+ """ Turns the LED on. """
11
16
self .value = 1
12
17
13
18
def off (self ):
19
+ """ Turns the LED off. """
14
20
self .value = 0
15
21
16
22
@property
17
23
def value (self ):
24
+ """ Returns the value of the LED (1 for on, 0 for off). """
18
25
return self ._value
19
26
20
27
@value .setter
21
28
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
+ """
22
33
self ._value = value
23
34
self ._buttons ._update_leds ()
24
35
You can’t perform that action at this time.
0 commit comments