![](/media/cache/group/220px-Herndon_Monument_Climb.jpg.50x50_q85.jpg)
Start of project 2
Dependencies: Motor Servo mbed mbed-rtos
Diff: main.cpp
- Revision:
- 3:50cee0fef078
- Parent:
- 0:9347308e8e1a
- Child:
- 4:a3e95c9d56d5
--- a/main.cpp Tue Oct 09 12:22:19 2018 +0000 +++ b/main.cpp Wed Oct 10 12:26:05 2018 +0000 @@ -3,20 +3,27 @@ #include "Motor.h" #include "math.h" - -Motor m(p26, p30, p29); -int i; -char x; -int j; +Motor m(p26,p30,p29); +DigitalIn fire (p16,p17,p18,p19,p20); -int main() { - - while(1){ - m.speed(1); - getchar(); - m.speed(-1); - getchar(); - } //end of while loop - +int main() +{ + fire.read; + if (fire==1) { + while(1) { + m.speed(1); + wait (.15); + m.speed(0); + wait (1); + break; + } + while(1) { + m.speed(-.25); + wait(.6); + m.speed(0); + wait(1); + break; + } + } + } //end of int main - \ No newline at end of file