// loadcell HX711 driving 7-seg display
#include <HX711.h>
const byte sck_pin = A0;
const byte dout_pin = A1;
float sensorReading = 0.0;
HX711 scale; // define object called scale
void setup() {
Serial.begin(115200);
pinMode(dout_pin, INPUT);
pinMode(sck_pin, INPUT);
scale.begin(dout_pin, sck_pin);
scale.set_scale(210.f); //2280.f // this value is obtained by calibrating the scale with known weights; see the README for details
scale.tare();
}
//int i = 0;
void loop() {
float sensorReading = (scale.get_units());
int x = map(sensorReading,0,10,0,9);
Serial.println(x,HEX);
delay(1000);
}