Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of Lab_6_WaG by
Diff: utility.cpp
- 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;
}
