Includes both the servo and Dc motor. Needs more comments on the servo side.
Dependencies: Motor Servo mbed
Fork of lab3integrated by
lab3integrated.cpp
- Committer:
- corwinstites
- Date:
- 2018-09-27
- Revision:
- 0:f5f82650e679
- Child:
- 1:efdd0b0bbdbc
File content as of revision 0:f5f82650e679:
#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); } } }