Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello here is a small update of the documentation, especially about the color and distance sensor.
The description of the modes was not up to date.
Accepted values for
set_color
and returned values forCOLOR_INDEX
modes are not quiet documented but it's unclear for me.First, I don't have this sensor and I don't know if COLOR_INDEX is the detected color by the sensor, or the current color of
the RGB led.
About
set_color
: it appears it accept only BLACK/NONE, RED, GREEN and BLUE according to pybricks:https://github.com/pybricks/pybricks-micropython/blob/master/pybricks/pupdevices/pb_type_pupdevices_colordistancesensor.c
About the detection ability: the official documentation shows "6 colors".
https://brickset.com/sets/88007-1/
Idem in:
https://github.com/JorgePe/BOOSTreveng/blob/master/ColorDistanceSensor.md
I implemented in my own library (https://github.com/ysard/MyOwnBricks) the following colors:
COLOR_NONE 0xFF
COLOR_BLACK 0
COLOR_BLUE 3
COLOR_GREEN 5
COLOR_YELLOW 7
COLOR_RED 9
COLOR_WHITE 10
So there would be an inversion in the naming of the CYAN-GREEN colors here:
pylgbst/pylgbst/peripherals.py
Lines 19 to 20 in 6fc3bf4
About the distance, I don't think it is represented in inches or cm since the data is supposed to be mapped from 0 to 10.
Source:
https://github.com/pybricks/pybricks-micropython/blob/5bf7d4e49ca084bfab3f8889642867b8c49e7a84/pybricks/pupdevices/pb_type_pupdevices_colordistancesensor.c#L115
and:
https://docs.pybricks.com/en/stable/pupdevices/colordistancesensor.html#pybricks.pupdevices.ColorDistanceSensor.distance
and:
JorgePe/BOOSTreveng#33 (comment)
Who is right?
Thanks for reading :p