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: Locate Move Servo button mbed
Fork of 2ndcomp by
Diff: main.cpp
- Revision:
- 9:94aa6a12b730
- Parent:
- 8:21f40f92215f
- Child:
- 10:118d86939032
diff -r 21f40f92215f -r 94aa6a12b730 main.cpp
--- a/main.cpp	Tue Sep 06 09:31:30 2016 +0000
+++ b/main.cpp	Wed Sep 07 04:58:16 2016 +0000
@@ -3,18 +3,31 @@
 #include "locate.h"
 #include "move.h"
 
+DigitalIn start(USER_BUTTON);
+DigitalOut buzzer(PB_10);
+
 int main()
 {
     setup();
     initmotor();
-
-    wait(1);
     
-    pmove(600, 0);
+    buzzer = 0;
+    while(start);
+    buzzer = 1;
+    wait_us(1);
+    while(!start);
+    while(start);
+    buzzer = 0;
     
-    back(300, 0);
-    
+    while(1)
+    {
+        back300();
+        pmove(300,300);
+        pmove(0,300);
+        pmove(0,0);
+    }
     while(1) {
         update();
     }
+    
 }
    