mirror of
https://github.com/eclipse/upm.git
synced 2025-07-03 02:11:15 +03:00
Added initial interfaces and some sensors implementing them
This commit is contained in:

committed by
Serban Waltter

parent
85608a9f61
commit
e7820f2831
@ -48,12 +48,12 @@ main()
|
||||
|
||||
// Instantiate a LM35 on analog pin A0, with a default analog
|
||||
// reference voltage of 5.0
|
||||
upm::LM35 sensor(0);
|
||||
upm::iTemperature* sensor = new upm::LM35(0);
|
||||
|
||||
// Every half second, sample the sensor and output the temperature
|
||||
|
||||
while (shouldRun) {
|
||||
cout << "Temperature: " << sensor.getTemperature() << " C" << endl;
|
||||
cout << "Temperature: " << sensor->getTemperature() << " C" << endl;
|
||||
|
||||
upm_delay_us(500000);
|
||||
}
|
||||
@ -61,6 +61,7 @@ main()
|
||||
//! [Interesting]
|
||||
|
||||
cout << "Exiting" << endl;
|
||||
delete sensor;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user