Add sanity check

This commit is contained in:
Kenwood 2021-07-04 20:36:13 -04:00
parent 13eb27b9c3
commit 32bd0f5b55
1 changed files with 9 additions and 7 deletions

View File

@ -33,6 +33,7 @@ void loop() {
// This method runs when we receive a message
void receiveEvent(int n) {
if (Wire.available() == 2) { // Dont do anything if this is not true
id = Wire.read(); // ID of the servo/device to access
val = Wire.read(); // Value to assign
@ -42,3 +43,4 @@ void receiveEvent(int n) {
break;
}
}
}