Voor Maarten

Dependencies:   MODSERIAL Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
Jannes
Date:
Fri Oct 20 10:12:45 2017 +0000
Commit message:
Standard Servo Test

Changed in this revision

MODSERIAL.lib Show annotated file Show diff for this revision Revisions of this file
Servo.lib Show annotated file Show diff for this revision Revisions of this file
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
diff -r 000000000000 -r c41f256db1d4 MODSERIAL.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MODSERIAL.lib	Fri Oct 20 10:12:45 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Sissors/code/MODSERIAL/#a3b2bc878529
diff -r 000000000000 -r c41f256db1d4 Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Fri Oct 20 10:12:45 2017 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r c41f256db1d4 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Oct 20 10:12:45 2017 +0000
@@ -0,0 +1,30 @@
+// Continuously sweep the servo through it's full range
+#include "mbed.h"
+#include "Servo.h"
+#include "MODSERIAL.h"
+
+InterruptIn button3(D10);
+Servo myservo(D9);
+int k=0;
+
+//Other
+MODSERIAL pc(USBTX, USBRX);  
+
+int main() {
+    myservo.calibrate(0.005,60);
+    pc.baud(115200);
+    while(1) {
+        for(int i=0; i<100; i++) {
+            myservo = i/100;
+            wait(0.1);
+            float Posi = myservo.read();
+            pc.printf("\r Position = %.4f \n",Posi);
+        }
+        for(int i=100; i>0; i--) {
+            myservo = i/100;
+            wait(0.1);
+            float Posi = myservo.read();
+            pc.printf("\r Position = %.4f \n",Posi);
+        }
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r c41f256db1d4 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Oct 20 10:12:45 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a330f0fddbec
\ No newline at end of file