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.
Dependencies: Motordriver mbed-rtos mbed
Fork of MultiModalRobotSM by
main.cpp
- Committer:
- baijun
- Date:
- 2017-11-20
- Revision:
- 14:f413a2b209b0
- Parent:
- 13:4c609396ed75
- Child:
- 15:9bc36f47c8cf
File content as of revision 14:f413a2b209b0:
//This will rotate the wheels so that after 5 seconds the robot counterclockwise and then clockwise
#include "mbed.h"
#include "rtos.h"
#include "motordriver.h"
Motor lw(p26, p29, p30, 1); // pwm, fwd, rev LEFT WHEEL
Motor rw(p25, p28, p27, 1); // pwm, fwd, rev RIGHT WHEEL
int main() {
wait(5);
for (float s= -1.0; s < 1.0 ; s += 0.01) {
lw.speed(s);
rw.speed(-s);
wait(0.02);
}
lw.stop(0.5);
rw.stop(0.5);
}
