Integrated Lab
Dependencies: Motor Servo mbed
Diff: lab3integrated.cpp
- Revision:
- 0:f5f82650e679
- Child:
- 1:efdd0b0bbdbc
diff -r 000000000000 -r f5f82650e679 lab3integrated.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lab3integrated.cpp Thu Sep 27 19:01:43 2018 +0000 @@ -0,0 +1,30 @@ +#include "mbed.h" +#include "Servo.h" + +Servo kenny(p21); +Servo barb(p22); + +int main() +{ + barb.calibrate(0.0009,90); + kenny.calibrate(0.0009,90); + kenny = 0; + barb = 1; + while(1) + { + float i; + for (i=0; i<90; i++) + { + barb = 1 - i*0.0111; + kenny = i*0.0111; + wait(.0555); + } + float j; + for (j=0; j<90; j++) + { + kenny = 1 - j*0.0111; + barb = j*0.0111; + wait(.0555); + } + } +}