#include <LiquidCrystal.h>
#include "HX711.h"
#include <LiquidCrystal.h>
LiquidCrystal lcd(13,11,5,4,3,2);
const int calibration_factor = 426.0;
const int LOADCELL_DOUT_PIN = 8;
const int LOADCELL_SCK_PIN = 12;
HX711 scale;
const int numRows = 2;
const int numCols = 16;
void setup() {
Serial.begin(9600);
Serial.println("HX711 scale ");
lcd.begin(0x27,16, 2);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale(calibration_factor);
scale.tare();
Serial.println("Readings:");
}
void loop() {
Serial.print("Reading: ");
Serial.print(scale.get_units(), 1);
Serial.print(" g");
Serial.println();
//LCD display code:
lcd.clear();
lcd.setCursor(0,0);
lcd.print("weight: ");
lcd.setCursor(6,1);
lcd.print(scale.get_units(), 3); //scale.get_units() returns a float
lcd.print("gm");
delay(5000);
}