//place known weights and write down what it says on the display
#include "HX711_ADC.h"
#include <LiquidCrystal_I2C.h>
const int loadConstant = 420;
const int tareButton = 13;
float weight;
#define I2C_ADDR 0x27
#define LCD_COLUMNS 16
#define LCD_LINES 2
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_LINES);
HX711_ADC LoadCell(A1, A0);
void setup() {
pinMode(tareButton, INPUT);
Serial.begin(9600);
lcd.init();
lcd.backlight();
LoadCell.begin();
LoadCell.start(1000);
LoadCell.setCalFactor(1);
}
void loop() {
LoadCell.update();
weight = LoadCell.getData()/loadConstant;
Serial.println(weight);
lcd.setCursor(5, 0);
lcd.print(weight);
if (digitalRead (tareButton) == LOW){
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("Taring");
LoadCell.start(1000);
lcd.clear();
}
}
uno:A5.2
uno:A4.2
uno:AREF
uno:GND.1
uno:13
uno:12
uno:11
uno:10
uno:9
uno:8
uno:7
uno:6
uno:5
uno:4
uno:3
uno:2
uno:1
uno:0
uno:IOREF
uno:RESET
uno:3.3V
uno:5V
uno:GND.2
uno:GND.3
uno:VIN
uno:A0
uno:A1
uno:A2
uno:A3
uno:A4
uno:A5
cell1:VCC
cell1:DT
cell1:SCK
cell1:GND
lcd1:GND
lcd1:VCC
lcd1:SDA
lcd1:SCL
btn1:1.l
btn1:2.l
btn1:1.r
btn1:2.r
r1:1
r1:2