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:
- 0:5b2bf6e79b07
- Child:
- 1:201d986498c7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/motors.cpp Thu May 08 19:11:31 2014 +0000
@@ -0,0 +1,17 @@
+#include "motors.h"
+
+Motors::Motors(TB6612 * L, TB6612 * R, PinName STBY):
+ Left(L), Right(R), enable(STBY)
+{
+ enable = 1;
+}
+
+void Motors::flip()
+{
+ TB6612 * temp = Left;
+ Left = Right;
+ Right = temp;
+
+ Left->scale *= -1;
+ Right->scale *= -1;
+}
\ No newline at end of file