upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

API for the TCS3414CS Color Sensor. More...

Detailed Description

This module defines the TCS3414CS interface for the color sensor

tcs3414cs.jpg
// Instantiate the color sensor on I2C
// 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;
upm_delay_us(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

Parameters
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.

Parameters
rgbColor values
void clearInterrupt ( void  )

Clears interrupts.

std::string name ( )
inline

Returns the name of the component


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