Servo
Dependencies: mbed MODSERIAL Servo FastPWM
main.cpp
- Committer:
- AnkePost
- Date:
- 2019-10-11
- Revision:
- 3:91b8945b659d
- Parent:
- 2:381007cb7a70
- Child:
- 4:8ae0c82c2d60
File content as of revision 3:91b8945b659d:
#include "mbed.h" #include "Servo.h" Serial pc(USBTX, USBRX); Servo myservo(D5); int main() { while(1) { for(int i=0; i<100; i++) { myservo = i/100.0; wait(0.01); pc.printf("Naar voren"); } for(int i=100; i>0; i--) { myservo = i/100.0; wait(0.01); pc.printf("Naar achteren"); } } }