upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
TCS3414CS Class Reference

API for the TCS3414CS Color Sensor. More...

Detailed Description

This module defines the TCS3414CS interface for the color sensor

// Instantiate the color sensor on I2C
sensor = new upm::TCS3414CS ();
// Print out the r, g, b, and clr value every 0.5 seconds
while (!doWork) {
sensor->readRGB (&rgb);
std::cout << (int)rgb.r << ", " << (int)rgb.g << ", " << (int)rgb.b << ", " << rgb.clr << std::endl;
usleep (500000);

Public Member Functions

 TCS3414CS (int bus=0, int addr=DEFAULT_ADDR)
void readRGB (tcs3414sc_rgb_t *rgb)
void clearInterrupt ()
std::string name ()

Constructor & Destructor Documentation

TCS3414CS ( int  bus = 0,
int  addr = DEFAULT_ADDR 

Instantiates a TCS3414CS object

busNumber of the used bus
addrI2C address of the device

Member Function Documentation

void readRGB ( tcs3414sc_rgb_t rgb)

Gets the RGB value from the sensor.

rgbColor values
void clearInterrupt ( void  )

Clears interrupts.

std::string name ( )

Returns the name of the component

The documentation for this class was generated from the following files: