![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Servo
Dependencies: mbed MODSERIAL Servo FastPWM
main.cpp
- Committer:
- AnkePost
- Date:
- 2019-10-11
- Revision:
- 4:8ae0c82c2d60
- Parent:
- 3:91b8945b659d
- Child:
- 5:74962b191242
File content as of revision 4:8ae0c82c2d60:
#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\n\r"); } for(int i=100; i>0; i--) { myservo = i/100.0; wait(0.01); pc.printf("Naar achteren\n\r"); } } }