improvements to rendering floats

This commit is contained in:
proddy
2019-03-24 11:54:49 +01:00
parent 599171202c
commit c7c07eb1c4
6 changed files with 177 additions and 150 deletions

View File

@@ -182,6 +182,7 @@ int16_t DS18::getRawValue(unsigned char index) {
}
// return real value as a double
// The raw temperature data is in units of sixteenths of a degree, so the value must be divided by 16 in order to convert it to degrees.
double DS18::getValue(unsigned char index) {
double value = (float)getRawValue(index) / 16.0;
return value;