mirror of https://github.com/arendst/Tasmota.git
Update xdrv_26_lm75ad.ino to support C or F
Update xdrv_26_lm75ad.ino to support C or F depending on Settings.flag.temperature_conversion (#define TEMP_CONVERSION 0 or 1) as stored in [SetOption8] Return temperature in (0 = Celsius or 1 = Fahrenheit)
This commit is contained in:
parent
c860927857
commit
289b662f10
|
@ -75,6 +75,9 @@ float LM75ADConvertTemp(uint16_t t) {
|
||||||
t=t>>5; // shift value into place (5 LSB not used)
|
t=t>>5; // shift value into place (5 LSB not used)
|
||||||
tmpt=t*0.125;
|
tmpt=t*0.125;
|
||||||
}
|
}
|
||||||
|
if (!isnan(tmpt) && Settings.flag.temperature_conversion) {
|
||||||
|
tmpt = tmpt * 1.8 + 32; // Fahrenheit
|
||||||
|
}
|
||||||
return tmpt;
|
return tmpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue