Color Sensors and Loops
By combining color sensors with loops, a greater understanding of color sensor may be achieved.
Main program flow: Robot begins on starting blue, needs to move off the line to start and then it look for blue or
If while blue sensor is < 50" means it hasn't hit blue yet, but once blue is greater than 50, the statement is false, so it moves on to the next task.
So overall it's not identifying blue in the loop, it's identifying while there's not blue, wait.
Color Sensors use RGB values
while blue sensor is on blue (>50) the sensor moves forward off the blue. ( the sensor reads blue) and while it is on gray (<50) it keeps going and when it sees blue it is false
Why is this sensor detecting White
White RGB code = Red 255 Green 255 Blue 255
The color sensor is trying to find red which has a RGB -R number around the >150
IF the sensor does not detect a red value greater than 100- the statement is true- the robot/code does not continue to the next line.
The robot moves until the red color sensor goes higher than 100--or the robot moves as long as the statement is true. The sensor is not detecting a red value/number greater than R100. When the robot crosses the red tape, the Red ensor number goes above 100 and the statement is false, when this statement is false the robot goes to the next line of code,
For more information:
FTC Color Sensor Tutorial Using a Color Sensor Part 1 https://www.youtube.com/watch?v=iQufRF1HFRc
Or Using a Color Sensor Part 2 start 1:11
https://www.youtube.com/watch?v=uSEEO3_JVTI
FTC Sim Color Sensor https://www.youtube.com/watch?v=70sV821oa5o
Last updated