22 #ifndef _TemperatureSensor_H_
23 #define _TemperatureSensor_H_
28 #if defined(CONF_DSENSOR)
75 return 93.8136 - 0.122241 *
static_cast<float>(
get() >> 6);
83 float F()
const {
return C() * 1.8 + 32;}
90 int tenths()
const {
return static_cast<int>(
C() * 10.);}
97 int degrees()
const {
return static_cast<int>(
C());}
100 #else // CONF_DSENSOR
101 #warning Enable CONF_DSENSOR to use TemperatureSensor.H
102 #endif // CONF_DSENSOR
103 #endif // _TemperatureSensor_H_
int tenths() const
Get the current temperature in C * 10, as an int.
C++ Sensor Class Interface.
int degrees() const
Get the current temperature in C, as an int.
~TemperatureSensor()
Destroy this instance of TemperatureSensor.
TemperatureSensor(const Sensor::Port port)
Construct a temperature sensor.
float F() const
Get the current temperature in F.
Port
List of sensor identifiers (IDs).
float C() const
Get the current temperature in Celsius.
Temperature-sensor interface.