Go to the documentation of this file.
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_
TemperatureSensor(const Sensor::Port port)
Construct a temperature sensor.
int tenths() const
Get the current temperature in C * 10, as an int.
int degrees() const
Get the current temperature in C, as an int.
float F() const
Get the current temperature in F.
~TemperatureSensor()
Destroy this instance of TemperatureSensor.
C++ Sensor Class Interface.
kernel configuration file
unsigned int get() const
Get the current sensor reading.
Port
List of sensor identifiers (IDs).
float C() const
Get the current temperature in Celsius.
Generated for brickOS Kernel Developer by
1.8.16