make it more stable

This commit is contained in:
Joerg Lehmann 2020-05-27 15:10:40 +02:00
parent d2e4b81416
commit b71e0c0f0c
1 changed files with 3 additions and 2 deletions

View File

@ -97,8 +97,9 @@ long ReadScale(char channel)
for (int i = 0; i < num_scale_readings; i++) {
//while (digitalRead(interruptPin) == LOW) {
while (! myScale.available()) {
// we set a timeout of 60 seconds for the measurement...
if ((millis() - startTime) > 60000) {
// we set a timeout of 10 seconds for the measurement...
if ((millis() - startTime) > 10000) {
Wire.endTransmission(true);
if (debug_level > 0) {
gCatena.SafePrintf("Timeout while reading scale...\n");
}