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

Dependencies:   mbed QEI Servo HIDScope biquadFilter MODSERIAL FastPWM

Revision:
0:009a005982e5
Child:
1:1b33fd02e6b1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 29 19:12:00 2019 +0000
@@ -0,0 +1,32 @@
+/* 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);
+        }
+    }
+
+}
+
+
+