![](/media/cache/group/9e3cc099b3b04bca937a1cca1da81b19.jpg.50x50_q85.jpg)
servo motor werkt eindelijk!!!! wiehoe!!!
Dependencies: mbed QEI Servo HIDScope biquadFilter MODSERIAL FastPWM
main.cpp
- Committer:
- jasperkessels
- Date:
- 2019-10-29
- Revision:
- 0:009a005982e5
- Child:
- 1:1b33fd02e6b1
File content as of revision 0:009a005982e5:
/* servo motor program - biorbotics groep 8 */ #include <Servo.h> #include <mbed.h> #include <math.h> /* cos */ #include <MODSERIAL.h> MODSERIAL pc(USBTX, USBRX); Servo myservo(D3); int main() { myservo.Enable(1500,20000); while(true) { pc.printf("starting"); for (int pos = 1000; pos < 2000; pos += 25) { myservo.SetPosition(pos); wait_ms(20); } for (int pos = 2000; pos > 1000; pos -= 25) { myservo.SetPosition(pos); wait_ms(20); } } }