From 055062cfefdb7eadc48e844bd3d7d14525d3bae5 Mon Sep 17 00:00:00 2001 From: Sam Archer Date: Fri, 4 May 2012 01:26:37 -0700 Subject: [PATCH] Updated to Arduino 1.0 code. Fixed reset-bug (Thank you knorke74 !) --- Arduino/Moppy/{Moppy.pde => Moppy.ino} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename Arduino/Moppy/{Moppy.pde => Moppy.ino} (98%) diff --git a/Arduino/Moppy/Moppy.pde b/Arduino/Moppy/Moppy.ino similarity index 98% rename from Arduino/Moppy/Moppy.pde rename to Arduino/Moppy/Moppy.ino index 67a94d8..3dc5ec4 100644 --- a/Arduino/Moppy/Moppy.pde +++ b/Arduino/Moppy/Moppy.ino @@ -89,7 +89,10 @@ void loop(){ //Watch for special 100-message to reset the drives if (Serial.peek() == 100) { resetAll(); - Serial.flush(); + //Flush any remaining messages. + while(Serial.available() > 0){ + Serial.read(); + } } else{ currentPeriod[Serial.read()] = (Serial.read() << 8) | Serial.read();