here's a basic way to get the servos running back and not really forth. Next to come, integration of the servo.

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
jkangwi
Date:
Thu Oct 16 18:45:41 2014 +0000
Commit message:
This sucker may actually work;

Changed in this revision

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 f8b0e15576fe Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Thu Oct 16 18:45:41 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r f8b0e15576fe main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 16 18:45:41 2014 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#include "Servo.h"
+
+
+
+Servo myservo1(p21); //top
+Servo myservo2(p22); //bottom
+
+int main()
+{
+    while(1) {
+
+        float servopos;
+        //servopos=0.38;
+
+
+
+        while(servopos=servopos+0.03; servopos<=.67) {
+            servopos=servopos+0.03;
+            myservo1=servopos+.28;
+            myservo2=servopos;
+            printf("Servo 1 position %.2f Servo 2 position %.2f\n\r", servopos, (servopos));
+        }
+        while(servopos>=.39) {
+            servopos=servopos-.03;
+            myservo1=servopos+.24;
+            myservo2=servopos;
+            printf("Servo 1 position %.2f Servo 2 position %.2f\n\r", servopos, (servopos));
+        }
+
+    }
+}
diff -r 000000000000 -r f8b0e15576fe mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 16 18:45:41 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file