#include "HX711.h"
#include <Q2HX711.h>
#include <Servo.h>
Servo myservo;
const byte hx711_data_pin = D5;
const byte hx711_clock_pin = D6;
int servoPin= 8;
float weight= 500;
HX711 scale;
Q2HX711 hx711(hx711_data_pin, hx711_clock_pin);
void setup() {
Serial.begin(9600);
scale.begin(hx711_data_pin, hx711_clock_pin);
scale.set_scale(96.3);
scale.tare(50);
myservo.attach(8,600,2300);
}
void loop() {
// float h = hx711.read()/100.0;
float weight = scale.get_units(25);
Serial.println(weight);
if (weight < 200) {
myservo.write(90);
delay(1000);
}
}
#include <Q2HX711.h>
#include <Servo.h>
Servo myservo;
const byte hx711_data_pin = D5;
const byte hx711_clock_pin = D6;
int servoPin= 8;
float weight= 500;
HX711 scale;
Q2HX711 hx711(hx711_data_pin, hx711_clock_pin);
void setup() {
Serial.begin(9600);
scale.begin(hx711_data_pin, hx711_clock_pin);
scale.set_scale(96.3);
scale.tare(50);
myservo.attach(8,600,2300);
}
void loop() {
// float h = hx711.read()/100.0;
float weight = scale.get_units(25);
Serial.println(weight);
if (weight < 200) {
myservo.write(90);
delay(1000);
}
}