servo motor werkt eindelijk!!!! wiehoe!!!

Dependencies:   mbed QEI Servo HIDScope biquadFilter MODSERIAL FastPWM

Files at this revision

API Documentation at this revision

Comitter:
IsaRobin
Date:
Tue Oct 29 19:29:45 2019 +0000
Parent:
0:009a005982e5
Child:
2:f92eadfd1a27
Commit message:
servo motor redelijk werkend;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Oct 29 19:12:00 2019 +0000
+++ b/main.cpp	Tue Oct 29 19:29:45 2019 +0000
@@ -7,20 +7,24 @@
 
 
 MODSERIAL pc(USBTX, USBRX);
+
+
 Servo myservo(D3);
 
 
 int main()
 {
-myservo.Enable(1500,20000);
+    pc.baud(115200);
+    pc.printf("starting main .\r.\n");
+    myservo.Enable(1500,20000);
 
     while(true) {
         pc.printf("starting");
-        for (int pos = 1000; pos < 2000; pos += 25) {
+        for (int pos = 1000; pos < 2000; pos += 10) {
             myservo.SetPosition(pos);
             wait_ms(20);
         }
-        for (int pos = 2000; pos > 1000; pos -= 25) {
+        for (int pos = 2000; pos > 1000; pos -= 10) {
             myservo.SetPosition(pos);
             wait_ms(20);
         }
--- a/mbed.bld	Tue Oct 29 19:12:00 2019 +0000
+++ b/mbed.bld	Tue Oct 29 19:29:45 2019 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file
+https://os.mbed.com/users/mbed_official/code/mbed/builds/d1b4690b3f8b
\ No newline at end of file