#include "HX711.h"
#include <LiquidCrystal.h>
LiquidCrystal lcd(1, 2, 4, 5, 6, 7);
#define calibration_factor 421.863
#define LOADCELL_DOUT_PIN 8
#define LOADCELL_SCK_PIN 12
HX711 scale;
const int numRows = 2;
const int numCols = 16;
void setup() {
Serial.begin(9600);
Serial.println("HX711 scale ");
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(" kg");
Serial.println();
//LCD display code:
lcd.clear();
lcd.setCursor(0, 1);
lcd.print(scale.get_units(), 3); //scale.get_units() returns a float
lcd.print(" kg ");
delay(2000);
}