Color Sensor Values
The VEX IQ Color sensor is capable of several different modes:Real Robot users
Virtual Robot users
As the color sensor is pointed at differently colored objects, the values on the screen update. Certain hue values correspond with certain color names. If the lighting in the environment varies, so do the sensor readings. |
Mini Challenge 1: Red Light, Green Light, Go!
In addition to stopping at a red light, it’s important for self-driving cars to resume driving once the light switches to green.
|
You will need an additional WaitUntil command block after the one configured to wait until Red.
After the robot has detected a color Red, what is the color it should wait for before it moves forward?
|
Mini Challenge 2: Forward to Stop Line
|
Virtual VEX IQ | Choose the following configuration in RVW. |
Physical VEX IQ | Download and follow building instruction below if the robot is not yet built. VEX IQ Build Instructions [PDF] |
You can use the same waitUntil-behavior to make the robot stop at a line on the floor.
If the road is dark, and the stop line is Yellow, the robot should be able to detect Yellow. If the road is white, and the stop line is Red, the robot should be able to detect Black.
How does it work?
Color Sensor
You can use the following color names in your programs for
the Color Sensor:
colorNone | colorRedViolet | colorRed | colorDarkOrange | colorOrange |
colorDarkYellow | colorYellow | colorLimeGreen | colorGreen | colorBlueGreen |
colorBlue | colorDarkBlue | colorViolet | ||