#include <LiquidCrystal_I2C.h> //library untuk lcd
#include "HX711.h" // library untuk loadcell
#define I2C_ADDR 0x27
#define LCD_COLUMNS 20
#define LCD_LINES 4
#define DOUT 2
#define CLK 3
#define calibration_factor 410.00
HX711 scale;
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_LINES);
int GRAM;
void setup() {
Serial.begin(9600);
scale.begin(DOUT,CLK);
scale.set_scale(calibration_factor);
scale.tare();
lcd.init();
}
void loop() {
scale.set_scale(calibration_factor);
GRAM = scale.get_units(), 4;
Serial.println(GRAM);
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Massa:");
lcd.setCursor(7,0);
lcd.print(GRAM);
delay(100);
}