Added initial interfaces and some sensors implementing them

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Mihai Stefanescu
2018-06-12 18:46:49 +03:00
committed by Mihai Tudor Panu
parent 6bf21a23e7
commit f035470822
102 changed files with 1183 additions and 182 deletions

View File

@ -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;
}