From 69754c283f65703c99028c5a33df9e39b901edb2 Mon Sep 17 00:00:00 2001 From: Sarah Knepper Date: Fri, 16 Jan 2015 10:27:12 -0800 Subject: [PATCH] tcs3414cs: Add comments to C++ example for the Grove color sensor Signed-off-by: Sarah Knepper --- examples/tcs3414cs.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/tcs3414cs.cxx b/examples/tcs3414cs.cxx index c3bcd642..5e6376e3 100644 --- a/examples/tcs3414cs.cxx +++ b/examples/tcs3414cs.cxx @@ -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;