#include "HX711.h" // HX711 Pins const int LOADCELL_DOUT_PIN = 2; // Waage DOUT const int LOADCELL_SCK_PIN = 3; // Waage SCK #define FilterFaktor 0.5 // running average Filter Einstellung int zeler = 1, rauschen; long reading, val_f; HX711 scale; int i; long min_wert, max_wert, mittel_wert = 0; void setup() { Serial.begin(115200); Serial.println("HX711 Start"); scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN); delay(1000); } void loop() { reading = scale.read(); min_wert = reading; max_wert = reading; delay(100); for (i = 0; i < 50; i++) { if (scale.is_ready()) { reading = scale.read(); if (reading < min_wert) min_wert = reading; if (reading > max_wert) max_wert = reading; mittel_wert += reading; } else i--; delay(100); } mittel_wert = mittel_wert / 50; rauschen = (max_wert - min_wert) / 2; Serial.print("Rauschen: +- "); Serial.println(rauschen); Serial.print("Mittelwert: "); Serial.println(mittel_wert); Serial.println(""); Serial.println(""); val_f=mittel_wert; }