kopia lustrzana https://github.com/micropython/micropython-lib
drivers/led/neopixel: Clamp brightness between 0.0 and 1.0.
Signed-off-by: Tom Mount <tmountjr@gmail.com>pull/739/head
rodzic
69f6d61881
commit
47c5dbc4d5
|
@ -44,8 +44,8 @@ class NeoPixel:
|
|||
self[i] = v
|
||||
|
||||
def set_brightness(self, b: float):
|
||||
self.brightness = b
|
||||
for i in range(self.n):
|
||||
self.brightness = min(max(b, 0.0), 1.0)
|
||||
for i in range(self.n)
|
||||
self[i] = self[i]
|
||||
|
||||
def write(self):
|
||||
|
|
Ładowanie…
Reference in New Issue