> For the complete documentation index, see [llms.txt](https://guides.mccaskeyrobotics.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.mccaskeyrobotics.org/ftc/sensors/rev-color-sensor-v3.md).

# 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&#x20;
* Hue&#x20;
* Red&#x20;
* Blue&#x20;
* Green

&#x20;

Full Guide from REV Robotics: <https://docs.revrobotics.com/color-sensor/>&#x20;

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>&#x20;

Supporting Images:

<figure><img src="/files/KfJz6rDubvw1rrnfSY6E" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/M1IQacsIyQ3Cu4cQl2zn" alt=""><figcaption></figcaption></figure>

### Useful code:

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

<figure><img src="/files/t74Lv3y05KZDx8KBdHwu" alt=""><figcaption></figcaption></figure>

Hardware map it!:

<figure><img src="/files/Fms3GJ3DLU4apv7qcgMS" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/tOEmqsVgfZq0qz0B5yW0" alt=""><figcaption></figcaption></figure>

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!\*
