#include <HX711.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define DOUT_PIN 3
#define CLK_PIN 2
HX711 scale(DOUT_PIN, CLK_PIN);
LiquidCrystal_I2C lcd(0x3F, 16, 2);
void setup() {
Serial.begin(9600);
lcd.init(); // inisialisasi LCD
lcd.backlight(); // nyalakan backlight
scale.set_scale();
scale.tare();
}
void loop() {
float weight = scale.get_units(1);
lcd.clear(); // hapus layar
lcd.setCursor(0,0); // set kursor ke baris pertama
lcd.print("Weight: ");
lcd.print(weight, 1);
lcd.print(" kg");
delay(1000);
}