test

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
Khanchana
Date:
Tue Jan 30 09:49:27 2018 +0000
Commit message:
test

Changed in this revision

Servolibrary.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 96e1eeadbd56 Servolibrary.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servolibrary.lib	Tue Jan 30 09:49:27 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r 96e1eeadbd56 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jan 30 09:49:27 2018 +0000
@@ -0,0 +1,33 @@
+// Hello World to sweep a servo through its full range
+ 
+#include "mbed.h"
+#include "Servo.h"
+ 
+Servo myservo1(D7);
+Servo myservo2(D6);
+ 
+int main() {
+    myservo1.calibrate(0.0005,0.0);
+    myservo2.calibrate(0.0005,0.0);          
+    for(float p=0.87; p>=0.375; p -= 0.005) {
+        myservo1 = p;
+
+        wait(0.01);
+    }
+    wait(2);
+    for(float n=0.75; n>=0; n -= 0.005) {
+        myservo2 = n;
+        wait(0.01);
+    }
+    wait(2);
+    /*for(float p=0.375; p<=0.87; p += 0.005) {
+        myservo1 = p;
+        wait(0.01);
+    }
+    wait(2);
+    for(float p=0; p<=0.75; p += 0.005) {
+        myservo2 = p;
+        wait(0.01);
+    }
+    wait(2);*/
+}
\ No newline at end of file
diff -r 000000000000 -r 96e1eeadbd56 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jan 30 09:49:27 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7130f322cb7e
\ No newline at end of file