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 racing_robots by
Revision 11:dbec260681a7, committed 2016-05-19
- Comitter:
- sillevl
- Date:
- Thu May 19 13:16:14 2016 +0000
- Parent:
- 7:a72215b1910b
- Commit message:
- add xbee support to racing robots library
Changed in this revision
robot_logic.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/robot_logic.cpp Wed Feb 25 15:56:14 2015 +0000 +++ b/robot_logic.cpp Thu May 19 13:16:14 2016 +0000 @@ -3,9 +3,9 @@ // Some defines #define MAX_SPEED 100 #define MAX_SENSOR 100 -#define MAX_REAL_SPEED 0.75 +#define MAX_REAL_SPEED 0.3 -#define MIN 0 +#define MIN -MAX_SPEED // Static scope variables static m3pi m3pi; @@ -60,6 +60,7 @@ left = MIN; else if (left > MAX_SPEED) left = MAX_SPEED; + m3pi.left_motor(MAX_REAL_SPEED*left/MAX_SPEED); m3pi.right_motor(MAX_REAL_SPEED*right/MAX_SPEED); }