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: Command.cpp
- Revision:
- 10:6e32b53f04c3
- Parent:
- 6:bbaabcc5206d
- Child:
- 11:6c56d8ca6e99
--- a/Command.cpp Sat Nov 28 23:20:31 2015 +0000
+++ b/Command.cpp Sun Nov 29 00:02:54 2015 +0000
@@ -57,6 +57,21 @@
}
}
+void GoStraightCommand :: execute()
+{
+ _STBY = 1;
+ if(_IS_NEGATIVE)
+ {
+ _RIGHT_WHEEL.speed(-_SPEED);
+ _LEFT_WHEEL.speed(-_SPEED);
+ }
+ else
+ {
+ _RIGHT_WHEEL.speed(_SPEED);
+ _LEFT_WHEEL.speed(_SPEED);
+ }
+}
+
void StopCommand :: execute()
{
_RIGHT_WHEEL.speed(0.0);