Hey guys. First post, so bear with me. Time is of the essence, as my team will be leaving for Seattle in just over a week for a robotics competition. We are running into some problems with the color sensor.
Scope:
The sensor must distinguish between: red, yellow, blue, and green "fish" (wood cutouts) to be able to correctly sort them.
Hardware:
We are using the Waveshare Color sensor found here. The relevant documents and User Guide are in the Wiki created by the company and the sample code is attached.
Problems:
I cannot seem to get the code to distinguish between colors. Rather, if it is recognizing the colors, I do not know what I am looking at because the outputs in the Serial Monitor are not outputting RGB values between 0 and 255 (they can be much larger). I have verified that the hookup is correct to the arduino. I would also like to have the code only require white balance once at the beginning as this robot must operate on its own. Also attached is the sample of what the serial monitor is reading with a red fish in front of the sensor.
Any help is greatly appreciated.
Color_Sensor.ino (3.81 KB)