tcs3414cs: Add comments to C++ example for the Grove color sensor

Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
This commit is contained in:
Sarah Knepper 2015-01-16 10:27:12 -08:00
parent 99700d7d1f
commit 69754c283f

View File

@ -45,8 +45,11 @@ main(int argc, char **argv)
{
//! [Interesting]
upm::tcs3414sc_rgb_t rgb;
// 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;