Lab 2 RC
Dependencies: Motor Servo mbed
Diff: main.cpp
- Revision:
- 0:7af9f9bb814c
- Child:
- 1:55b6172d1930
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Oct 13 04:06:07 2015 +0000 @@ -0,0 +1,27 @@ +/*Matthew Sims + RC Control + Moves a servo back in forth in small incriments + 10/13/15 +*/ + +#include "mbed.h" +#include "Motor.h" +#include "Servo.h" + +Servo s(p21); + +int main() +{ + s.calibrate(.0009,90); + + while(1) { + for(int pos=0; pos<=18; pos++) { + s(pos/18.0); + getchar(); + } + for(int pos=18; pos>=0; pos--) { + s(pos/18.0); + getchar(); + } + } +}