10/15/14 code

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
alphasig
Date:
Wed Oct 15 19:19:40 2014 +0000
Commit message:
actual code

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	Wed Oct 15 19:19:40 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Servo/#36b69a7ced07
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Oct 15 19:19:40 2014 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "Servo.h"
+
+Servo myservo1(p21);
+Servo myservo2(p22);
+
+
+DigitalIn sw1(p16);
+DigitalIn sw2(p17);
+DigitalIn sw3(p18);
+DigitalIn sw4(p19);
+
+int switch1=sw1;
+int switch2=sw2;
+int switch3=sw3;
+int switch4=sw4;
+
+int main() {
+    
+    float servopos;
+    
+    while (switch1==1)
+    {
+        while (servopos <=.6)
+        {
+            myservo1= servopos;
+            servopos=servopos +.005;
+            wait(.01);
+            }
+            while (servopos >=.3)
+            {
+            myservo1=servopos;
+            servopos=servopos-.005;
+            wait(.01);
+            }
+            }
+            }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Oct 15 19:19:40 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file