![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
10/15/14 code
Revision 0:fbe913f85d70, committed 2014-10-15
- Comitter:
- alphasig
- Date:
- Wed Oct 15 19:19:40 2014 +0000
- Commit message:
- actual code
Changed in this revision
--- /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