We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68d63c7 commit 2e6d267Copy full SHA for 2e6d267
src/modulino/buttons.py
@@ -3,22 +3,33 @@
3
from micropython import const
4
5
class ModulinoButtonsLED():
6
+ """
7
+ Class to interact with the LEDs of the Modulino Buttons.
8
9
+
10
def __init__(self, buttons):
11
self._value = 0
12
self._buttons = buttons
13
14
def on(self):
15
+ """ Turns the LED on. """
16
self.value = 1
17
18
def off(self):
19
+ """ Turns the LED off. """
20
self.value = 0
21
22
@property
23
def value(self):
24
+ """ Returns the value of the LED (1 for on, 0 for off). """
25
return self._value
26
27
@value.setter
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
33
self._value = value
34
self._buttons._update_leds()
35
0 commit comments