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

getCelsius

Returns the temperature from the last read() in celsius.
Syntax
Temperature. getCelsius()
Where Temperature is the name you have given to the device in Project Designer.
Parameters
None
Returns
TEMPERATURE_TYPE
Example
Assuming you have called your sensor 'myTemp' in Project Designer:-
// Read the sensor and store the value
myTemp.read();
 
// Get value in celsius
TEMPERATURE_TYPE c = myTemp.getCelsius();
 
// Convert it to Fahrenheit
TEMPERATURE_TYPE f = Temperature::toFahrenheit(c);
 
// Print out the values
cout << "C=" << c << " F=" << f << '\n';

 

 

Valid XHTML 1.0 Transitional