Sharing is Caring
/
ECE4180Lab2DancingRobot
ok
Revision 0:1bbd6ec37b2d, committed 2019-02-18
- Comitter:
- mchan63
- Date:
- Mon Feb 18 20:41:07 2019 +0000
- Commit message:
- ok
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Motor.lib Mon Feb 18 20:41:07 2019 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/Motor/#f265e441bcd9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Feb 18 20:41:07 2019 +0000 @@ -0,0 +1,36 @@ +// Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0) + +#include "mbed.h" +#include "Motor.h" +Motor m1(p21, p19, p20); // pwm, fwd, rev +Motor m2(p22, p16, p15); // pwm, fwd, rev + +int main() { + while(1){ + m1.speed(.4); + m2.speed(.4); + wait(1); + m1.speed(0); + m2.speed(0); + wait(1); + m1.speed(-.4); + m2.speed(-.4); + wait(1); + m1.speed(0); + m2.speed(0); + wait(1); + m1.speed(-.5); + m2.speed(.5); + wait(1.75); + m1.speed(0); + m2.speed(0); + wait(1); + m1.speed(.5); + m2.speed(-.5); + wait(1.75); + m1.speed(0); + m2.speed(0); + wait(1); + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Feb 18 20:41:07 2019 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e