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.
Diff: motors.cpp
- Revision:
- 1:201d986498c7
- Parent:
- 0:5b2bf6e79b07
--- a/motors.cpp Thu May 08 19:11:31 2014 +0000
+++ b/motors.cpp Sun Oct 05 12:20:47 2014 +0000
@@ -14,4 +14,14 @@
Left->scale *= -1;
Right->scale *= -1;
-}
\ No newline at end of file
+}
+void Motors::reverse(bool m)
+{
+ if(m)
+ Right->scale *= -1; //reverse right motor
+ else
+ Left->scale *= -1; //reverse left motor
+}
+
+//TODO: write in a function that automatically sets the motors to be oriented properly. Use the
+//gyroscopes and accelerometer to do this.
\ No newline at end of file