Skip to content

Commit a086ea6

Browse files
committed
Add doc
1 parent ec3e268 commit a086ea6

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/arduino/app_utils/leds.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@
99

1010

1111
class Leds:
12+
"""
13+
A utility class for controlling LED colors on Arduino hardware.
14+
15+
This class provides static methods to control two RGB LEDs by writing to system
16+
brightness files. LED1 and LED2 can be controlled directly by the MPU, while
17+
LED3 and LED4 require MCU control via Bridge.
18+
19+
Attributes:
20+
_led_ids (list): List of supported LED IDs [1, 2].
21+
_led1_brightness_files (list): System file paths for LED1 RGB channels
22+
(red:user, green:user, blue:user).
23+
_led2_brightness_files (list): System file paths for LED2 RGB channels
24+
(red:panic, green:wlan, blue:bt).
25+
26+
Methods:
27+
set_led1_color(r, g, b): Set the RGB color state for LED1.
28+
set_led2_color(r, g, b): Set the RGB color state for LED2.
29+
30+
Example:
31+
>>> Leds.set_led1_color(True, False, True) # LED1 shows magenta
32+
>>> Leds.set_led2_color(False, True, False) # LED2 shows green
33+
"""
1234
_led_ids = [1, 2] # Supported LED IDs (Led 3 and 4 can't be controlled directly by MPU but only by MCU via Bridge)
1335

1436
_led1_brightness_files = [

0 commit comments

Comments
 (0)