Skip to content

Commit 43e8bba

Browse files
authored
Merge pull request #17 from per1234/example-handle-begin-fail
Prevent execution of the rest of example program if begin fails
2 parents a41c9b1 + b3203ef commit 43e8bba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/nau7802_test/nau7802_test.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ void setup() {
77
Serial.println("NAU7802");
88
if (! nau.begin()) {
99
Serial.println("Failed to find NAU7802");
10+
while (1) delay(10); // Don't proceed.
1011
}
1112
Serial.println("Found NAU7802");
1213

@@ -72,4 +73,4 @@ void loop() {
7273
}
7374
int32_t val = nau.read();
7475
Serial.print("Read "); Serial.println(val);
75-
}
76+
}

0 commit comments

Comments
 (0)