I made a weight sensor using a load cell.When I place a weight on the load cell and then cut the power and turn it back on, the program re-calibrates and displays zero even though the weight is still on the load cell.How do I change the program so that the correct weight is displayed even when I switch the arduino off and then back on.
#include <HX711_ADC.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
HX711_ADC LoadCell(4, 5);
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup() {
LoadCell.begin();
LoadCell.start(2000);
LoadCell.setCalFactor(999.0);
lcd.begin(16, 2);
lcd.backlight();
}
void loop() {
LoadCell.update();
float i = LoadCell.getData();
lcd.setCursor(0, 0);
lcd.print("Weight[g]:");
lcd.setCursor(0, 1);
lcd.print(i);
}