Colour Sensor not reading

I am switching from Lego EV3 to Vex Iq. I am going through some of my programs for next year, making sure that everything works.

I am having trouble with the colour sensor. I am trying to make the robot stay within a white area outlined with a thick black line.

I note that the sensor is not lighting up, as it does when I make the sensor test in the Device Info screen. When the program is running, the sensor returns a value of “22” without regard for what colour the sensor is over.


The image is of the Program (I don’t see how to post an image)

1 Like

You need to manually turn on the light with a set block.
image
You can set it to whatever percentage you like.
If you arent seeing good results after that, try checking the hue value on the color sensor instead. The brightness might not change all that much depending on how strong ambient light is in the room. The hue should return a number in degrees which you can see on this color wheel.


Personally, I like using hue more than color names and brightness because it gives you more control in defining what colors you want to detect.
You will need to test which light setting gives you the biggest hue difference between the two surfaces. The light is important in your case because technically white and black have the same hue angle of 0 degrees. However, these colors aren’t pure black and white and the light reflecting off of them will more clearly highlight the different hues. Color theory is weird so the hue value that the color sensor gives might not correspond 1:1 with what your eyes are seeing, but as long as you know what object matches up with that value you should be fine.

1 Like

Just to record what made it work. I was taking my numbers from the VEX Iq s’ sensor display on the controller. I needed to think about reflected light. I set the “Light to” 100%, in the setup portion of the program and I lowered the “Brightness %” to 10 and it worked.

3 Likes