Color Sensor

Liam Brady

Color sensors are series of photodiodes that can detect the amount of red, green, and blue light it is seeing. The version NuVu uses is Adafruit’s TCS34725 color sensor, and it interfaces with Arduinos using a library.

 

TCS34725 Library

#include <Wire.h>
#include "Adafruit_TCS34725.h"

Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_700MS, TCS34725_GAIN_1X);

void setup() {
  Serial.begin(9600);
  tcs.begin();
}


void loop() {
  uint16_t r, g, b, c;

  tcs.getRawData(&r, &g, &b, &c);

  Serial.println(r);
  Serial.println(g);
  Serial.println(b);
}