![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Servo control for shield NMHU (New Mexico Highlands University) KL-46Z. This will control two servos. at the same time back and forth.
main.cpp
- Committer:
- bomalley
- Date:
- 2015-03-12
- Revision:
- 0:6138ceae43f5
File content as of revision 0:6138ceae43f5:
#include "mbed.h" #include "Servo.h" #define WAITTIME 0.2 /* * Written by: Bresdin O'Malley 2015 * Servo control for shield NMHU (New Mexico Highlands University) KL-46Z. * This will control two servos. */ Servo myservo1(PTC9); Servo myservo2(PTC8); int main() { while(true) { for(float p=0; p<1.0; p += 0.1) { myservo1.write(p); myservo2.write(p); wait(WAITTIME); } } }