Hello
Dependencies: Motor Servo mbed
Revision 0:d07fffb33419, committed 2014-10-09
- Comitter:
- m174770
- Date:
- Thu Oct 09 15:31:19 2014 +0000
- Commit message:
- Kill
Changed in this revision
diff -r 000000000000 -r d07fffb33419 Motor.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Motor.lib Thu Oct 09 15:31:19 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/Motor/#f265e441bcd9
diff -r 000000000000 -r d07fffb33419 Servo.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Servo.lib Thu Oct 09 15:31:19 2014 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/Tyfighters/code/Servo/#507223a4cf0e
diff -r 000000000000 -r d07fffb33419 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 09 15:31:19 2014 +0000 @@ -0,0 +1,38 @@ +#include "mbed.h" +#include "Servo.h" +#include "Motor.h" + +Servo myservo1(p22); //inititalize motors and servo +DigitalIn sw2(p17); +DigitalIn sw3(p18); + + +int main() +{ + float servopos; //current position of servos + float waittime=0.02; + while(1) { + if(sw2==1) { + servopos=0.5; + while(sw2==1) { + servopos+=0.0025; + wait(waittime); + myservo1=servopos; + + } + } + if(sw3==1) { + servopos=myservo1; + + while(sw3==1) { + servopos-=0.0025; + wait(waittime); + myservo1=servopos; + + } + } + } +} + + +
diff -r 000000000000 -r d07fffb33419 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 09 15:31:19 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1 \ No newline at end of file