![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
this isn't working the servo just twitches
Dependencies: Servo mbed Motor
Diff: main.cpp
- Revision:
- 1:7fa77283f89e
- Parent:
- 0:22157cad3c1e
- Child:
- 2:c754297f78ff
--- a/main.cpp Sun Oct 05 17:05:46 2014 +0000 +++ b/main.cpp Thu Oct 09 14:44:06 2014 +0000 @@ -2,15 +2,36 @@ #include "Servo.h" Servo launchservo(p21); -DigitalIn sw3(p18); +BusOut lights(p5, p6, p7, p8); +DigitalIn sw4(p19); int launchswitch; -int main() { - - while(1){ +int main() +{ + float i; launchservo=0; - launchswitch=sw3.read(); - }//hey guys when I'm testing this code the servo just twitches it doesn't rotate I don't know whats up - - + while(1) { + + //launchswitch=sw3.read(); + if(sw4) { + lights=15; + wait(.5); + lights=14; + wait(.5); + lights=12; + wait(.5); + lights=8; + wait(.5); + lights=0; + wait(.5); + printf("a\n"); + for (i=0; i<=1.0; i+=.01) { + launchservo=i; + printf("b\n"); + wait(.01); + + } + + } + } - +}