#include "HX711.h"
#define LOADCELL_DOUT_PIN A0
#define LOADCELL_SCK_PIN A1
#define BUZZER_PIN 8
HX711 scale;
void setup() {
Serial.begin(9600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
pinMode(BUZZER_PIN, OUTPUT);
}
void loop() {
float weight = scale.get_units();
Serial.print("Weight: ");
Serial.print(weight);
Serial.println(" kg");
if (weight > 25.0) {
digitalWrite(BUZZER_PIN, HIGH); // Turn on the buzzer
} else {
digitalWrite(BUZZER_PIN, LOW); // Turn off the buzzer
}
delay(500); // Adjust the delay as needed
}