Skip to content

Commit

Permalink
Merge pull request #204 from rancilio-pid/fix-compiler-error-if-scale…
Browse files Browse the repository at this point in the history
…-used

Update scalevoid.h
  • Loading branch information
murmeltier08 authored Feb 13, 2022
2 parents 9d124d7 + b3b3831 commit 8b3bcb9
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions rancilio-pid/rancilio-pid/scalevoid.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,30 @@
long stabilizingtime = 2000; // tare preciscion can be improved by adding a few seconds of stabilizing time
boolean _tare = true; //set this to false if you don't want tare to be performed in the next step
DEBUG_print(F("INIT: Initializing scale ... "));
u8g2.clearBuffer();
u8g2.drawStr(0, 2, "Taring scale,");
u8g2.drawStr(0, 12, "remove any load!");
u8g2.drawStr(0, 22, "....");
delay(2000);
u8g2.sendBuffer();
#if (DISPLAY != 0)
u8g2.clearBuffer();
u8g2.drawStr(0, 2, "Taring scale,");
u8g2.drawStr(0, 12, "remove any load!");
u8g2.drawStr(0, 22, "....");
delay(2000);
u8g2.sendBuffer();
#endif
LoadCell.start(stabilizingtime, _tare);
if (LoadCell.getTareTimeoutFlag()) {
DEBUG_println(F("Timeout, check MCU>HX711 wiring and pin designations"));
u8g2.drawStr(0, 32, "failed!");
u8g2.drawStr(0, 42, "Scale not working..."); // scale timeout will most likely trigger after OTA update, but will still work after boot
delay(5000);
u8g2.sendBuffer();
#if (DISPLAY != 0)
u8g2.drawStr(0, 32, "failed!");
u8g2.drawStr(0, 42, "Scale not working..."); // scale timeout will most likely trigger after OTA update, but will still work after boot
delay(5000);
u8g2.sendBuffer();
#endif
}
else {
DEBUG_println(F("done"));
u8g2.drawStr(0, 32, "done.");
u8g2.sendBuffer();
#if (DISPLAY != 0)
u8g2.drawStr(0, 32, "done.");
u8g2.sendBuffer();
#endif
}
LoadCell.setCalFactor(calibrationValue); // set calibration factor (float)
}
Expand Down

0 comments on commit 8b3bcb9

Please sign in to comment.