#include "HX711.h"
// Define the pins for the HX711
#define DOUT 2
#define CLK 3
HX711 scale;
void setup() {
Serial.begin(9600);
scale.begin(DOUT, CLK);
scale.set_scale(); // This value is obtained by calibrating the scale with known weights
}
void loop() {
// Read the weight from the load cell
float weight = scale.get_units(10); // Read 10 times and take the average
Serial.print("Weight: ");
Serial.print(weight);
Serial.println(" kg");
delay(1000); // Update every second
}