I'm following a line with the LEGO EV3 Color Sensor in Reflected-light mode, I need to stop the robot when it detects a green tile in the ground, but I didn't succeeded in differentiating Green and Black, can I access the RGB values of the sensor, or in some way differentiate those colors?
2 Answers
Green does tend to be tricky on the LEGO EV3 Color sensor. Example
Here are some suggestions:
- Build a shroud to eliminate ambient light. I have seen people use electrical tape for this or build something from LEGO parts.
- Using the raw RGB values, convert to HSV (there is a link in Example 1 for this).
- Use the algorithm for the NXT color sensor from the EV3 source code. It will probably have to be adjusted a bit for differences in the sensors.