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.
Fork of Team5robotkode by
Diff: robot.cpp
- Revision:
- 8:5ca76759a67e
- Parent:
- 7:a852e63cac3d
- Child:
- 9:f14532fd7a02
diff -r a852e63cac3d -r 5ca76759a67e robot.cpp
--- a/robot.cpp Fri Dec 09 12:32:21 2016 +0000
+++ b/robot.cpp Mon Dec 12 13:35:34 2016 +0000
@@ -21,36 +21,20 @@
/////////////////////////////////////////////////////////////////////////////
// Driving setup //
/////////////////////////////////////////////////////////////////////////////
- while(1) //Remember to include if statement to stop robot if it's time to recharge
- {
- read_analog();
- startfunction();
- get_to_goal();
- robot.stop();
- printf("\n\r DistanceBysensor: %.2f \n", Dcenter());
- wait_ms(2000);
-
- read_analog();
- startfunction();
- get_to_goal();
- robot.stop();
- printf("\n\r DistanceBysensor: %.2f \n", Dcenter());
- wait_ms(2000);
-
- read_analog();
- startfunction();
- get_to_goal();
- robot.stop();
- printf("\n\r DistanceBysensor: %.2f \n", Dcenter());
- wait_ms(2000);
-
- read_analog();
- startfunction();
- get_to_goal();
- robot.stop();
- printf("\n\r DistanceBysensor: %.2f \n", Dcenter());
- wait_ms(2000);
- }
+
+ while(1)
+ {
+ startfunction();
+ get_to_goal();
+ robot.stop();
+ printf("\n\r DistanceBysensor: %.2f \n", Dcenter());
+ wait_ms(2000);
+
+ init();
+ startfunction();
+ turn();
+ robot.stop();
+ }
}
/*
----------------------------------------------------------------------------
