GroupA / Mbed 2 deprecated WaG_final

Dependencies:   mbed

Fork of Lab_6_WaG by GroupA

Revision:
26:58befaac9643
Parent:
23:3da1d39c1ae9
Child:
31:0dc2b4a3eee6
--- a/utility.cpp	Thu Mar 22 15:29:58 2018 +0000
+++ b/utility.cpp	Thu Mar 22 15:40:48 2018 +0000
@@ -25,9 +25,10 @@
     if (my_button == 0)
         return 0; // exits if button is not pressed
     else {
-        while (my_button == 1) { //cycle until button is released
-                wait(0.02); //20 ms
-        }
+        //cycle until button is released
+        do { 
+        wait(0.02); 
+        } while (my_button == 1) 
         wait(0.02); //delay to prevent debounce
         return 1;
     }