REV Color Sensor V3

This sensor is emits light and then analyzes the reflected light that it sees. It is capable of measuring:

  • raw distance up to 10cm (but most effective under 2cm)

  • Alpha

  • Hue

  • Red

  • Blue

  • Green

Full Guide from REV Robotics: https://docs.revrobotics.com/color-sensor/

Color Sensor Class Documentation: http://ftctechnh.github.io/ftc_app/doc/javadoc/index.html

Distance Sensor Class Documentation: http://ftctechnh.github.io/ftc_app/doc/javadoc/index.html

Supporting Images:

Useful code:

Add your sensor object with the rest of your robot objects:

Hardware map it!:

Add some code like this to your main loop to read the values on your sensor:

Try something like this to drive until your sensor sees a red line:

while( color.red() < 100){
    backLeft.setPower(.5);
    backRight.setPower(.5);
    frontLeft.setPower(.5);
    frontRight.setPower(.5);
}
backLeft.setPower(0);
backRight.setPower(0);
frontLeft.setPower(0);
frontRight.setPower(0);

*Note, this code is not intended to work right off the bat… this is just an idea of how you could use a color sensor to control your robot!*

Last updated

Was this helpful?