Skip to content

Commit 88a028c

Browse files
authored
Merge pull request #9 from caternuson/iss1
Limit LED current.
2 parents e73cea4 + bc5f4d9 commit 88a028c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_as7341.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def led_current(self):
616616
@led_current.setter
617617
@_low_bank
618618
def led_current(self, led_curent):
619-
new_current = int((led_curent - 4) / 2)
619+
new_current = int((min(258, max(4, led_curent)) - 4) / 2)
620620
self._led_current_bits = new_current
621621

622622
@property

0 commit comments

Comments
 (0)