examples/c++/<sensor>.cxx: changed cout / endl to std::cout / std::endl

Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Norbert Wesp 2017-02-14 13:33:17 +01:00 committed by Mihai Tudor Panu
parent aecdac255d
commit 545e288967
5 changed files with 32 additions and 32 deletions

View File

@ -42,7 +42,7 @@ int main(int argc, char **argv)
signal(SIGINT, sig_handler); signal(SIGINT, sig_handler);
//! [Interesting] //! [Interesting]
cout << "Initializing test-application..." << endl; std::cout << "Initializing test-application..." << std::endl;
// Instantiate an HDC1000 instance on bus 1 // Instantiate an HDC1000 instance on bus 1
upm::HDC1000 *mySensor = new upm::HDC1000(1); upm::HDC1000 *mySensor = new upm::HDC1000(1);
@ -50,15 +50,15 @@ int main(int argc, char **argv)
// update and print available values every second // update and print available values every second
while (run) while (run)
{ {
cout << "Humidity: " << mySensor->getHumidity(true) << endl std::cout << "Humidity: " << mySensor->getHumidity(true) << std::endl
<< "Temperature: " << mySensor->getTemperature(true) << endl; << "Temperature: " << mySensor->getTemperature(true) << std::endl;
cout << endl; std::cout << std::endl;
sleep(1); sleep(1);
} }
cout << "Exiting test-application..." << endl; std::cout << "Exiting test-application..." << std::endl;
delete mySensor; delete mySensor;
//! [Interesting] //! [Interesting]

View File

@ -44,7 +44,7 @@ int main(int argc, char **argv)
//! [Interesting] //! [Interesting]
upm::mag3110_data_t data; upm::mag3110_data_t data;
cout << "Initializing test-application..." << endl; std::cout << "Initializing test-application..." << std::endl;
// Instantiate an MAG3110 instance on bus 1 // Instantiate an MAG3110 instance on bus 1
upm::MAG3110 *mySensor = new upm::MAG3110(1); upm::MAG3110 *mySensor = new upm::MAG3110(1);
@ -56,18 +56,18 @@ int main(int argc, char **argv)
while (run) while (run)
{ {
mySensor->getData (&data, true); mySensor->getData (&data, true);
cout << "x: " << data.x << endl std::cout << "x: " << data.x << std::endl
<< "y: " << data.y << endl << "y: " << data.y << std::endl
<< "z: " << data.z << endl << "z: " << data.z << std::endl
<< "Status: " << data.status << endl << "Status: " << data.status << std::endl
<< "Die temperature: " << data.dtemp << endl; << "Die temperature: " << data.dtemp << std::endl;
cout << endl; std::cout << std::endl;
sleep(1); sleep(1);
} }
cout << "Exiting test-application..." << endl; std::cout << "Exiting test-application..." << std::endl;
delete mySensor; delete mySensor;
//! [Interesting] //! [Interesting]

View File

@ -55,7 +55,7 @@ int main(int argc, char **argv)
params.offsetZ = <z-axis offset>; between 0 and 255 params.offsetZ = <z-axis offset>; between 0 and 255
*/ */
cout << "Initializing test-application..." << endl; std::cout << "Initializing test-application..." << std::endl;
// Instantiate an MMA8X5X instance on bus 1 with default parameters // Instantiate an MMA8X5X instance on bus 1 with default parameters
// The sensor-type will be detected by reading out the device-id // The sensor-type will be detected by reading out the device-id
@ -73,16 +73,16 @@ int main(int argc, char **argv)
while (run) while (run)
{ {
mySensor->getData (&data, true); mySensor->getData (&data, true);
cout << "x: " << (int)data.x << endl std::cout << "x: " << (int)data.x << std::endl
<< "y: " << (int)data.y << endl << "y: " << (int)data.y << std::endl
<< "z: " << (int)data.z << endl; << "z: " << (int)data.z << std::endl;
cout << endl; std::cout << std::endl;
sleep(1); sleep(1);
} }
cout << "Exiting test-application..." << endl; std::cout << "Exiting test-application..." << std::endl;
delete mySensor; delete mySensor;
//! [Interesting] //! [Interesting]

View File

@ -44,7 +44,7 @@ int main(int argc, char **argv)
//! [Interesting] //! [Interesting]
upm::tcs37727_data_t data; upm::tcs37727_data_t data;
cout << "Initializing test-application..." << endl; std::cout << "Initializing test-application..." << std::endl;
// Instantiate an TCS37727 instance on bus 1 // Instantiate an TCS37727 instance on bus 1
upm::TCS37727 *mySensor = new upm::TCS37727(1); upm::TCS37727 *mySensor = new upm::TCS37727(1);
@ -56,19 +56,19 @@ int main(int argc, char **argv)
while (run) while (run)
{ {
mySensor->getData (&data, true); mySensor->getData (&data, true);
cout << "Red: " << (int)data.red << endl std::cout << "Red: " << (int)data.red << std::endl
<< "Green: " << (int)data.green << endl << "Green: " << (int)data.green << std::endl
<< "Blue: " << (int)data.blue << endl << "Blue: " << (int)data.blue << std::endl
<< "Clear: " << (int)data.clear << endl << "Clear: " << (int)data.clear << std::endl
<< "Lux: " << (int)data.lux << endl << "Lux: " << (int)data.lux << std::endl
<< "Color temperature: " << (int)data.ct << endl; << "Color temperature: " << (int)data.ct << std::endl;
cout << endl; std::cout << std::endl;
sleep(1); sleep(1);
} }
cout << "Exiting test-application..." << endl; std::cout << "Exiting test-application..." << std::endl;
delete mySensor; delete mySensor;
//! [Interesting] //! [Interesting]

View File

@ -42,7 +42,7 @@ int main(int argc, char **argv)
signal(SIGINT, sig_handler); signal(SIGINT, sig_handler);
//! [Interesting] //! [Interesting]
cout << "Initializing test-application..." << endl; std::cout << "Initializing test-application..." << std::endl;
// Instantiate an TMP006 instance on bus 1 // Instantiate an TMP006 instance on bus 1
upm::TMP006 *mySensor = new upm::TMP006(1); upm::TMP006 *mySensor = new upm::TMP006(1);
@ -54,13 +54,13 @@ int main(int argc, char **argv)
while (run) while (run)
{ {
// Print out temperature value in °C // Print out temperature value in °C
cout << "Temperature: " << mySensor->getTemperature(true) << " °C" std::cout << "Temperature: " << mySensor->getTemperature(true) << " °C"
<< endl; << std::endl;
sleep(1); sleep(1);
} }
cout << "Exiting test-application..." << endl; std::cout << "Exiting test-application..." << std::endl;
delete mySensor; delete mySensor;
//! [Interesting] //! [Interesting]