//************************************//
// Schubmessstand //
// //
// Automatische Messung und Übertra- //
// gung von Schubdaten von Propellern //
//Libaries einbinden
#include <HX711.h> // Loadcell
//Pins definieren
const byte lcSCK = 2;
const byte lcSDA = 3;
// LC Objekt anlegen
HX711 scale;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
// LC Initialisieren
// Initialize library with data output pin, clock input pin and gain factor.
// Channel selection is made by passing the appropriate gain:
// - With a gain factor of 64 or 128, channel A is selected
// - With a gain factor of 32, channel B is selected
// By omitting the gain factor parameter, the library
// default "128" (Channel A) is used here.
scale.begin(lcSDA, lcSCK);
scale.set_scale(0.42);
scale.tare();
}
void loop() {
// put your main code here, to run repeatedly:
if (scale.is_ready()) {
long reading = scale.read();
Serial.print("HX711 reading: ");
Serial.println(reading);
} else {
Serial.println("HX711 not found.");
}
delay(500);
}