My color sensor is not working


#1

The color sensor we are using is not working right. It does not pick up the right color. Any tips on how to make it work?


#2

I suspect the colour sensor is working OK, but your program is not dealing with the data very well. Which programming language are you using?


#3

I am using Modkit.


#4

OK, first to check it is working properly. Switch the Brain on so you are on the main menu, then press X on the Brain to enter settings. Go down to Device Info and then scroll through the devices until you find your colour sensor. By default, it will be in “3-color” mode which allows it to see red, green and blue. This mode is calibrated pretty well with the colour of the rings. Hold each ring in front of the sensor one at a time to check it is working. It will also show you how close you need to be to the sensor to get it to register.
The data you are seeing here is exactly the same as Modkit would return using the “COLOR SENSOR color” block.

Try that first to check it is working.