#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "HX711.h"
LiquidCrystal_I2C lcd(0x27, 16, 2); // Alamat I2C modul LCD dan ukuran kolom dan baris
HX711 scale;
void setup() {
lcd.init();
lcd.backlight();
scale.begin(DT_PIN, SCK_PIN); // Ganti DT_PIN dan SCK_PIN sesuai koneksi
scale.set_scale(); // Kalibrasi load cell
scale.tare(); // Nolkan tara (tanpa beban)
lcd.setCursor(0, 0);
lcd.print("Weight: ");
}
void loop() {
float weight = scale.get_units(10); // Baca berat dalam satuan tertentu (misalnya gram)
lcd.setCursor(8, 0);
lcd.print(weight, 1); // Menampilkan berat dengan 1 desimal
delay(1000);
}