#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27
#define LCD_COLUMNS 16
#define LCD_LINES 2
#include "HX711.h"
float x;
float y;
HX711 scale;
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_LINES);
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.backlight();
Serial.begin(9600);
scale.begin(A1, A0);
}
void loop() {
// put your main code here, to run repeatedly:
x = scale.get_units(), 1;
y = x/420;
Serial.println(y);
lcd.setCursor(1,0);
if (y < 34.0194){
lcd.print("9.5 inches");
}
if ((y > 34.0194) && (y < 45.3592)){
lcd.print("10 inches");
}
if (y > 45.3592){
lcd.print("10.5 inches");
}
delay(1000);
}