acd52832_servo example

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
jurica238814
Date:
Tue Sep 20 11:36:12 2016 +0000
Commit message:
acd52832_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
diff -r 000000000000 -r a855473fe62b Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Tue Sep 20 11:36:12 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r a855473fe62b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 20 11:36:12 2016 +0000
@@ -0,0 +1,18 @@
+// Continuously sweep the servo through it's full range
+#include "mbed.h"
+#include "Servo.h"
+
+Servo myservo(p26);
+
+int main() {
+    while(1) {
+        for(int i=0; i<100; i+=2) {
+            myservo = i/100.0;
+            wait(0.05);
+        }
+        for(int i=100; i>0; i-=2) {
+            myservo = i/100.0;
+            wait(0.05);
+        }
+    }
+}
diff -r 000000000000 -r a855473fe62b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Sep 20 11:36:12 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85
\ No newline at end of file