servo motor werkt eindelijk!!!! wiehoe!!!
Dependencies: mbed QEI Servo HIDScope biquadFilter MODSERIAL FastPWM
Diff: main.cpp
- Revision:
- 2:f92eadfd1a27
- Parent:
- 1:1b33fd02e6b1
- Child:
- 3:f30c2ded1a58
--- a/main.cpp Tue Oct 29 19:29:45 2019 +0000 +++ b/main.cpp Tue Oct 29 19:44:11 2019 +0000 @@ -16,18 +16,21 @@ { pc.baud(115200); pc.printf("starting main .\r.\n"); - myservo.Enable(1500,20000); + myservo.Enable(1410,20000); while(true) { - pc.printf("starting"); - for (int pos = 1000; pos < 2000; pos += 10) { + pc.printf("starting.\r.\n"); + + for (int pos = 1410; pos < 1590; pos += 5) { myservo.SetPosition(pos); wait_ms(20); } - for (int pos = 2000; pos > 1000; pos -= 10) { + pc.printf("kant 1.\r.\n"); + for (int pos = 1590; pos > 1410; pos -= 5) { myservo.SetPosition(pos); wait_ms(20); } + pc.printf("kant 2.\r.\n"); } }