@@ -39,12 +39,12 @@ def set_range_rgb(self, index_from, index_to, r, g, b, brightness=100):
39
39
Sets the color of the LEDs in the given range to the given RGB values.
40
40
41
41
Parameters:
42
- index_from (int): The starting index of the range.
43
- index_to (int): The ending index (inclusive) of the range.
44
- r (int): The red value of the color.
45
- g (int): The green value of the color.
46
- b (int): The blue value of the color.
47
- brightness (int): The brightness of the LED. It should be a value between 0 and 100.
42
+ index_from (int): The starting index of the range.
43
+ index_to (int): The ending index (inclusive) of the range.
44
+ r (int): The red value of the color.
45
+ g (int): The green value of the color.
46
+ b (int): The blue value of the color.
47
+ brightness (int): The brightness of the LED. It should be a value between 0 and 100.
48
48
"""
49
49
self .set_range_color (index_from , index_to , ModulinoColor (r , g , b ), brightness )
50
50
@@ -53,10 +53,10 @@ def set_range_color(self, index_from, index_to, color, brightness=100):
53
53
Sets the color of the LEDs in the given range to the given color.
54
54
55
55
Parameters:
56
- index_from (int): The starting index of the range.
57
- index_to (int): The ending index (inclusive) of the range.
58
- color (ModulinoColor): The color of the LEDs.
59
- brightness (int): The brightness of the LED. It should be a value between 0 and 100.
56
+ index_from (int): The starting index of the range.
57
+ index_to (int): The ending index (inclusive) of the range.
58
+ color (ModulinoColor): The color of the LEDs.
59
+ brightness (int): The brightness of the LED. It should be a value between 0 and 100.
60
60
"""
61
61
for i in range (index_from , index_to + 1 ):
62
62
self .set_color (i , color , brightness )
@@ -66,10 +66,10 @@ def set_all_rgb(self, r, g, b, brightness=100):
66
66
Sets the color of all the LEDs to the given RGB values.
67
67
68
68
Parameters:
69
- r (int): The red value of the color.
70
- g (int): The green value of the color.
71
- b (int): The blue value of the color.
72
- brightness (int): The brightness of the LED. It should be a value between 0 and 100.
69
+ r (int): The red value of the color.
70
+ g (int): The green value of the color.
71
+ b (int): The blue value of the color.
72
+ brightness (int): The brightness of the LED. It should be a value between 0 and 100.
73
73
"""
74
74
self .set_all_color (ModulinoColor (r , g , b ), brightness )
75
75
@@ -78,8 +78,8 @@ def set_all_color(self, color, brightness=100):
78
78
Sets the color of all the LEDs to the given color.
79
79
80
80
Parameters:
81
- color (ModulinoColor): The color of the LEDs.
82
- brightness (int): The brightness of the LED. It should be a value between 0 and 100.
81
+ color (ModulinoColor): The color of the LEDs.
82
+ brightness (int): The brightness of the LED. It should be a value between 0 and 100.
83
83
"""
84
84
self .set_range_color (0 , NUM_LEDS - 1 , color , brightness )
85
85
@@ -88,9 +88,9 @@ def set_color(self, idx, rgb : ModulinoColor , brightness=100):
88
88
Sets the color of the given LED index to the given color.
89
89
90
90
Parameters:
91
- idx (int): The index of the LED.
92
- rgb (ModulinoColor): The color of the LED.
93
- brightness (int): The brightness of the LED. It should be a value between 0 and 100.
91
+ idx (int): The index of the LED.
92
+ rgb (ModulinoColor): The color of the LED.
93
+ brightness (int): The brightness of the LED. It should be a value between 0 and 100.
94
94
"""
95
95
if idx < 0 or idx >= NUM_LEDS :
96
96
raise ValueError (f"LED index out of range { idx } (Valid: 0..{ NUM_LEDS - 1 } )" )
@@ -105,11 +105,11 @@ def set_rgb(self, idx, r, g, b, brightness=100):
105
105
Set the color of the given LED index to the given RGB values.
106
106
107
107
Parameters:
108
- idx (int): The index of the LED.
109
- r (int): The red value of the color.
110
- g (int): The green value of the color.
111
- b (int): The blue value of the color.
112
- brightness (int): The brightness of the LED. It should be a value between 0 and 100.
108
+ idx (int): The index of the LED.
109
+ r (int): The red value of the color.
110
+ g (int): The green value of the color.
111
+ b (int): The blue value of the color.
112
+ brightness (int): The brightness of the LED. It should be a value between 0 and 100.
113
113
"""
114
114
self .set_color (idx , ModulinoColor (r , g , b ), brightness )
115
115
@@ -118,7 +118,7 @@ def clear(self, idx):
118
118
Turns off the LED at the given index.
119
119
120
120
Parameters:
121
- idx (int): The index of the LED.
121
+ idx (int): The index of the LED.
122
122
"""
123
123
self .set_color (idx , ModulinoColor (0 , 0 , 0 ), 0 )
124
124
@@ -131,7 +131,7 @@ def clear_all(self):
131
131
Turns all the LEDs off.
132
132
133
133
Parameters:
134
- idx (int): The index of the LED
134
+ idx (int): The index of the LED
135
135
"""
136
136
self .data = bytearray ([0xE0 ] * NUM_LEDS * 4 )
137
137
0 commit comments