From 13eb27b9c354d8214a2db031509d9973a642eb0b Mon Sep 17 00:00:00 2001 From: KenwoodFox Date: Sun, 4 Jul 2021 20:34:15 -0400 Subject: [PATCH] Remove unnecicary loop --- crawler_software/arduino/crawler_slave/crawler_slave.ino | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crawler_software/arduino/crawler_slave/crawler_slave.ino b/crawler_software/arduino/crawler_slave/crawler_slave.ino index e3e6cad..8a1d2ee 100644 --- a/crawler_software/arduino/crawler_slave/crawler_slave.ino +++ b/crawler_software/arduino/crawler_slave/crawler_slave.ino @@ -33,10 +33,8 @@ void loop() { // This method runs when we receive a message void receiveEvent(int n) { - while (Wire.available()) { // loop through all but the last - id = Wire.read(); // ID of the servo/device to access - val = Wire.read(); // Value to assign - } + id = Wire.read(); // ID of the servo/device to access + val = Wire.read(); // Value to assign switch(id) { case 1: