Skip to content

Commit

Permalink
AddressChanger: add sanity check for new address
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed May 3, 2024
1 parent ee39818 commit 8052c97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/AddressChanger/AddressChanger.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ void setup() {
Wire1.begin();
Serial.begin(115200);
delay(1000);
if (new_address != 0 && (new_address < 8 || new_address > 0x77)) {
Serial.println("Address outside valid range");
while (1);
}
// Search for devices and wait for user confirmation
for (int i = 8; i < 128; i++) {
Wire1.beginTransmission(i);
Expand Down

0 comments on commit 8052c97

Please sign in to comment.