Change LM75AD output when no valid reading received from 0 to null (#24263)
This commit is contained in:
parent
229d8fbb24
commit
971ddc72e8
@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
|
||||
- ESP8266 platform update from 2025.10.00 to 2025.12.00 (#24254)
|
||||
- ESP32 Platform from 2025.12.30 to 2025.12.31, Framework (Arduino Core) from v3.1.7 to v3.1.8 and IDF from v5.3.4.251205 to v5.3.4.251223 (#24254)
|
||||
- Refactor Adafruit Seesaw soil driver (#24270)
|
||||
- LM75AD output when no valid reading received from 0 to null (#24263)
|
||||
|
||||
### Fixed
|
||||
- ESP32 BLE not starting (#24240)
|
||||
|
||||
@ -123,6 +123,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
|
||||
- Vid6608 library from v1.0.2 to v1.0.3 [#24218](https://github.com/arendst/Tasmota/issues/24218)
|
||||
- IRremoteESP8266 library from v2.8.6 to v2.8.6-ca474a6 [#24226](https://github.com/arendst/Tasmota/issues/24226)
|
||||
- Refactor Adafruit Seesaw soil driver [#24270](https://github.com/arendst/Tasmota/issues/24270)
|
||||
- LM75AD output when no valid reading received from 0 to null [#24263](https://github.com/arendst/Tasmota/issues/24263)
|
||||
- Update Zigbee WebUI [#24224](https://github.com/arendst/Tasmota/issues/24224)
|
||||
|
||||
### Fixed
|
||||
|
||||
@ -68,16 +68,18 @@ void LM75ADDetect(void) {
|
||||
}
|
||||
|
||||
float LM75ADGetTemp(void) {
|
||||
uint16_t t;
|
||||
if (I2cValidRead16(&t, lm75ad_address, LM75_TEMP_REGISTER, lm75ad_bus)) {
|
||||
int16_t sign = 1;
|
||||
|
||||
uint16_t t = I2cRead16(lm75ad_address, LM75_TEMP_REGISTER, lm75ad_bus);
|
||||
if (t & 0x8000) { // we are getting a negative temperature value
|
||||
if (t & 0x8000) { // We are getting a negative temperature value
|
||||
t = (~t) +0x20;
|
||||
sign = -1;
|
||||
}
|
||||
t = t >> 5; // shift value into place (5 LSB not used)
|
||||
t = t >> 5; // Shift value into place (5 LSB not used)
|
||||
return ConvertTemp(sign * t * 0.125f);
|
||||
}
|
||||
return NAN; // Will be changed to "null" by ext_vsprintf_P()
|
||||
}
|
||||
|
||||
void LM75ADShow(bool json) {
|
||||
float t = LM75ADGetTemp();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user