mirror of
https://github.com/eclipse/upm.git
synced 2025-07-03 18:31:13 +03:00
Added initial interfaces and some sensors implementing them
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
6bf21a23e7
commit
f035470822
@ -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