// Calibrating the load cell
#include "HX711.h"
// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = 4;
const int LOADCELL_SCK_PIN = 0;
HX711 scale;
void setup() {
Serial.begin(57600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
}
void loop() {
if(!scale.is_ready()) {
Serial.println("HX711 not found.");
delay(1000);
}
scale.set_scale();
Serial.println("Place a known weight on the scale...");
delay(5000);
long reading = scale.get_units(10);
Serial.print("Reading: ");
Serial.println(reading);
delay(1000);
}
//calibration factor will be the (reading)/(known weight)