In the API documents i have found the following
Lighting
Badgeware is fitted with four onboard white LEDs on the back of the board. These can be used as indicators, decoration or anything else you can think of. Tufty also has a front-mounted light sensor which
caselights()
Gets and sets the brightness value for the rear lighting on the badge.
Usage
.caselights() - Returns the current level of the rear LEDs as a tuple.
.caselights(level) - level - Brightness to set on all rear LEDs (0-255)
.caselights(level1, level2, level3, level4) - level1, level2, level3, level4 - Brightness to set for each rear LED individually (0-255)
Returns
None, or a tuple if no parameter specified.
And under Methods
badge.caselights([light1: int, light2: int, light3: int, light4: int]) -> None | tuple
If I run the folowing:
badge.caselights()
# Returns the current level of the rear LEDs as a tuple.
print(badge.caselights())
#badge.caselights(level)
#Brightness to set on all rear LEDs (0-255)
#level = 255
badge.caselights(110)
badge.caselights()
# Returns the current level of the rear LEDs as a tuple.
print(badge.caselights())
I get:
MPY: soft reboot
[0, 0, 0, 0]
[110, 110, 110, 110]
If I go to badge.caselights(113) though, I get this?
MPY: soft reboot
[0, 0, 0, 0]
Traceback (most recent call last):
File "<stdin>", line 8, in <module>
File "badgeware/badge.py", line 199, in caselights
OverflowError: overflow converting long int to machine word
Is it “0 to 255” or “0 to 100”, or is there a glitch somewhere?