mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 01:10:22 +03:00
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:
parent
99700d7d1f
commit
69754c283f
@ -45,8 +45,11 @@ main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
upm::tcs3414sc_rgb_t rgb;
|
upm::tcs3414sc_rgb_t rgb;
|
||||||
|
|
||||||
|
// Instantiate the color sensor on I2C
|
||||||
sensor = new upm::TCS3414CS ();
|
sensor = new upm::TCS3414CS ();
|
||||||
|
|
||||||
|
// Print out the r, g, b, and clr value every 0.5 seconds
|
||||||
while (!doWork) {
|
while (!doWork) {
|
||||||
sensor->readRGB (&rgb);
|
sensor->readRGB (&rgb);
|
||||||
std::cout << (int)rgb.r << ", " << (int)rgb.g << ", " << (int)rgb.b << ", " << rgb.clr << std::endl;
|
std::cout << (int)rgb.r << ", " << (int)rgb.g << ", " << (int)rgb.b << ", " << rgb.clr << std::endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user