mirror of
https://github.com/eclipse/upm.git
synced 2025-07-03 02:11:15 +03:00
examples: Added 'Interesting' tag to examples
* Added //! [Interesting] tag to all examples which were missing this * Removed windows CR/LF * Removed pointers from examples since these are not needed. Removed try/catch which seems to be there only to handle failing pointers and return value from main. * Reformatted examples when the formatting was wonky/inconstant. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
@ -30,17 +30,13 @@
|
||||
|
||||
int main ()
|
||||
{
|
||||
try {
|
||||
upm::MAX44009* lightSensor = new upm::MAX44009(EDISON_I2C_BUS);
|
||||
while (true) {
|
||||
float value = lightSensor->getVisibleLux();
|
||||
std::cout << "Light level = " << value << " lux" << std::endl;
|
||||
sleep(1);
|
||||
}
|
||||
delete lightSensor;
|
||||
} catch (std::exception& e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
//! [Interesting]
|
||||
upm::MAX44009 lightSensor(EDISON_I2C_BUS);
|
||||
while (true) {
|
||||
float value = lightSensor.getVisibleLux();
|
||||
std::cout << "Light level = " << value << " lux" << std::endl;
|
||||
sleep(1);
|
||||
}
|
||||
//! [Interesting]
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user