Shows a lab where we can servo motor move from left to right and right to left

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
EduRemo
Date:
Fri Feb 05 07:28:18 2016 +0000
Commit message:
FRCRCE

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 3d38b95d74a0 Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Fri Feb 05 07:28:18 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r 3d38b95d74a0 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Feb 05 07:28:18 2016 +0000
@@ -0,0 +1,20 @@
+// Hello World to sweep a servo through its full range
+
+#include "mbed.h"
+#include "Servo.h"
+
+Servo myservo(PTC1);
+
+
+int main() {   
+    while(1) {
+          for(int i=0; i<=100; i++) {
+              myservo = i/100.0;
+              wait(0.1);
+          }
+          for(int i=99; i>=0; i--) {
+              myservo = i/100.0;
+              wait(0.1);
+          }
+      }
+}
diff -r 000000000000 -r 3d38b95d74a0 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Feb 05 07:28:18 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file