#include "HX711_ADC.h"
#include <LiquidCrystal.h>
LiquidCrystal lcd(23, 22, 5, 17, 16, 4);
HX711_ADC LoadCell(19, 18);
int tare = 25;
const float overload = 5000.0;
void setup()
{
Serial.begin(9600);
pinMode (tare, INPUT_PULLUP);
LoadCell.begin();
LoadCell.start(1000);
LoadCell.setCalFactor(0.42);
lcd.begin(16, 2);
lcd.clear();
lcd.print("Weighing Scale");
}
void loop() {
LoadCell.update();
float i = LoadCell.getData();
Serial.println(i);
if ( i < overload)
{
lcd.setCursor(1, 1);
lcd.print(i,0);
lcd.print(" g ");
}
else
{
lcd.setCursor(1, 1);
lcd.print("Over Load");
}
if (digitalRead (tare) == LOW)
{
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("Taring----");
LoadCell.start(1000);
delay(200);
lcd.clear();
lcd.print("Weighing Scale");
}
delay(100);
}