upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables 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

tcs3414cs.jpg
// 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 ()
 
void readRGB (tcs3414sc_rgb_t *rgb)
 
void clearInterrupt ()
 
std::string name ()
 

Constructor & Destructor Documentation

TCS3414CS ( )

Instantiates a TCS3414CS object

Parameters
busNumber of the used bus

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: