Servo example

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
gcarmonar
Date:
Thu Nov 07 14:17:28 2013 +0000
Commit message:
Servo example

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Thu Nov 07 14:17:28 2013 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/simon/code/Servo/#36b69a7ced07
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 07 14:17:28 2013 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+#include "Servo.h"
+
+DigitalOut myled(LED1);
+Servo myservo(D8);
+
+int main() {
+    while(1) {
+        for (float i = 0; i <= 1.0; i+=0.001){
+            myservo.write(i);
+            wait(0.02);
+        }
+        for (float i = 1.0; i >= 0.0; i-=0.001){
+            myservo.write(i);
+            wait(0.02);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 07 14:17:28 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file