WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

Temperature

Supports temperature measurement.
All readings from this library are in 'celsius'.
Since all of the devices have been implemented in the same way then it means that you can swap one device for another by only changing the #include and the MAKE command used to create the device.
So here is the generic way to work with a <DEVICE> of a given <MAKE> and <MODEL>:-
// Include the relevant sensor file
#include "Sensors/Temperature/<MAKE>/<MODEL>.h"
// Create the device
<DEVICE> myTemperature = MAKE_<DEVICE>(ADC pin);
In your appInitHardware you should initialise the device:-
temperatureInit(myTemperature);
Then in your main loop you can read the sensor using:-
temperatureRead(myTemperature);
The value can then be read independently into a variable of type 'TEMPERATURE_TYPE':-
TEMPERATURE_TYPE celsious = myTemperature.temperature.celsius;
Or dumped to the current rprintf destination using:-
temperatureDump(myTemperature);

 

File

 

Valid XHTML 1.0 Transitional