#include <HX711.h>
HX711 scale;
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;
float weight;
void setup() {
Serial.begin(9600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale();
scale.tare();
}
void loop() {
weight = scale.get_units();
if (weight >= 4.0) {
Serial.println("Weight is 4kg or more");
}
delay(100);
}