Added initial interfaces and some sensors implementing them

This commit is contained in:
Mihai Stefanescu
2018-06-12 18:46:49 +03:00
committed by Serban Waltter
parent 85608a9f61
commit e7820f2831
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;
}