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?

  • Please aim to be as descriptive as possible in your question title to get the best possible answers. I've changed the title to what I believe is the subject of your answer, if this isn't the case, please feel free to improve it. – Ambo100 Apr 17 '16 at 14:53
up vote 2 down vote accepted

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.

Yes try this. Color RGB This is the Color RGB sensor block. Installation instruction can refer from here

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.