From be41a906bb6a18cc351157798f7a634093fe2c66 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sat, 19 May 2018 21:50:19 +0200 Subject: [PATCH] copierter Code --- src/main.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index de7b395..c52f512 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,9 +1,16 @@ #include +#include +// Scale Settings +const int SCALE_DOUT_PIN = D2; +const int SCALE_SCK_PIN = D3; +HX711 scale(SCALE_DOUT_PIN, SCALE_SCK_PIN); void setup() { - // put your setup code here, to run once: + Serial.begin(115200); + scale.set_scale();// <- set here calibration factor!!! + scale.tare(); } - void loop() { - // put your main code here, to run repeatedly: -} \ No newline at end of file + float weight = scale.get_units(1); + Serial.println(String(weight, 2)); +}