You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Limit to number of user defined colors when using Spike light sensor. #2900
Describe the bug
There seems to be a limit on the number of user defined colors when using the code AttmntClr.detectable_colors block. It fails to compile/run if more than 8 are included in the list - generates the python code with more than 8 entities but creates an error on running the code. This is when using a Spike Prime controller.
If all the defined colours in the example are added to the block it will fail as there are more than 8. Example only has eight included but more than 8 colors have been defined above this block.
Maybe the documentation could state the limit if it is hard to fix in the firmware.
This program runs OK on the 8 color detectable colors and "fails" on the 9 colors one with:
Traceback (most recent call last):
File "issue_2900_python.py", line 20, in <module>
ValueError: Invalid argument
I think the simplest way to fix this is an indication in the color sensor documentation like: You can have up to 8 colors in the detectable colors definition
Activity
BertLindeman commentedon Nov 17, 2026
Hello,
This is not the block coding but the python representation of it.
The python I created loosely based upon your snippet:
This program runs OK on the 8 color detectable colors and "fails" on the 9 colors one with:
I think the simplest way to fix this is an indication in the color sensor documentation like:
You can have up to 8 colors in the detectable colors definitionBert