// TP MODUL 5 // SENSOR LOAD CELL HX711 //
// A021044 // Hazen Nabil Yudhanto //
#include <HX711_ADC.h> // HX711_ADC library
#include <Wire.h>
#include <LiquidCrystal_I2C.h> // LiquidCrystal_12C library
HX711_ADC LoadCell(9, 10); // DT PIN , SCK PIN
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
LoadCell.begin();
LoadCell.start(2000);
LoadCell.setCalFactor(420.0983); // calibration factor
lcd.begin(16, 2);
lcd.backlight ();
}
void loop() {
LoadCell.update();
float i = LoadCell.getData();
lcd.setCursor(0, 0);
lcd.print("Weight[kg]:");
lcd.setCursor(0, 1);
lcd.print(i);
}