How to write the tare in the code for HX711

Hello.
I want to follow remotely the weight of my hives. So I'm using a HX711 module with balance and it works fine. working with a nodeMCU.
I have a question on the tare function : I want to write in my code the value of the tare (I don't want eah time I'm restarting the board to setup manually the tare as my hive will be on the balance) because I may need to stop the NodeMCU and so, I don't want to loose the value of the tare.
So the question is :slight_smile:

As I know the weight of the tare, how to "write" it in the code so that I soon as I restart the board, I will be able to see the weight of the hive ?

confusing. why don't you post your code?

The simplest way would be to define a constant variable at the top of the code and then just subtract that value from the value you read from you sensor.

If your tare value changes from time to time, you could also store it in EEPROM and retrieve it at power on.

1 Like

Sounds good. Thanks.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.