Questions regarding TCS230DB programming
Lex
Posts: 13
I'm trying to incorporate the color sensor into my autonomous robot. The user will input the target's color and the robot will navigate using the sensors.
The question is, should I create a library of RGB values such that when the user input a color, the corresponding RGB values will be loaded?
If this is the case, how can I create a range of RGB values that the sensor can detect?
The question is, should I create a library of RGB values such that when the user input a color, the corresponding RGB values will be loaded?
If this is the case, how can I create a range of RGB values that the sensor can detect?
Comments
····ABS(Rsample - Rtarget) MIN ABS(Gsample - Gtarget) MIN ABS(Bsample - Btarget)
In other words it's the absolute difference between the color components that are furthest apart. The closest color will be the one with the smallest distance, as measured above. In other words, you're MINImizing the MAXimum distance. You can also set a threshold for "close enough", in case the unknown color is "none of the above".
-Phil