When the ESP32 wakes up from deep sleep, it runs the code from the beginning. If tare() is used, a new offset will be created each time, which will produce a reading of 0 even if there is an object on the load cell. To overcome this, one could store a TARE_OFFSET variable in the RTC RAM and use that instead of tare(). To do that, we need a set_offset() function.
Use case:
When the ESP32 wakes up from deep sleep, it runs the code from the beginning. If
tare()
is used, a new offset will be created each time, which will produce a reading of 0 even if there is an object on the load cell. To overcome this, one could store aTARE_OFFSET
variable in the RTC RAM and use that instead oftare()
. To do that, we need aset_offset()
function.