#include "HX711.h" #include #include #define calibration_factor 59000 //This value is obtained using the SparkFun_HX711_Calibration sketch #define DOUT A1 #define CLK A2 HX711 scale; char buff[10]; void setup() { Serial.begin(9600); Serial.println("HX711 scale demo"); scale.begin(DOUT, CLK); scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0 Serial.println("Readings:"); Slave.begin(); } void loop() { Serial.print("Reading: "); Slave.writeRegisters(scale.get_units()); //scale.get_units() returns a float Serial.print(scale.get_units(),4); //scale.get_units() returns a float Serial.print(" kg"); //You can change this to kg but you'll need to refactor the calibration_factor Serial.println(); }