Joshua Liu
/
GloveBoxTester
glovebox tester
Fork of GloveBoxTester by
Revision 4:9d0aa204aa20, committed 2014-02-28
- Comitter:
- joliu
- Date:
- Fri Feb 28 22:26:30 2014 +0000
- Parent:
- 3:ae51b59d29b8
- Commit message:
- Glovebox
Changed in this revision
GloveBoxTester.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r ae51b59d29b8 -r 9d0aa204aa20 GloveBoxTester.cpp --- a/GloveBoxTester.cpp Tue Jul 23 15:30:46 2013 +0000 +++ b/GloveBoxTester.cpp Fri Feb 28 22:26:30 2014 +0000 @@ -1,10 +1,10 @@ #include "mbed.h" - +Serial pc(USBTX, USBRX); Serial lcd(p13,p14); -DigitalOut pneumatics1(p25); -DigitalOut pneumatics2(p26); +DigitalOut pn1(p25); +DigitalOut pn2(p26); DigitalOut box1(p23); DigitalOut box2(p22); DigitalOut box3(p21); @@ -44,63 +44,61 @@ int count = 1; -int cycles = 2500; +int cycles = 3500; int check = 0; int main() { - clearLCD(); - setLCDpos(1,1); - lcd.printf("Here we go!"); + //clearLCD(); + //setLCDpos(1,1); + //lcd.printf("Here we go!"); while(count< cycles) { - if (pause) { check = 1; - //Trigger solenoid + + //Trigger Gloveboxes box1 = 1; box2 = 0; box3 = 0; - wait(.08); - + wait(.15); box1 = 0; box2 = 1; - wait(.08); - + box3 = 0; + wait(.15); + box1 = 0; box2 = 0; box3 = 1; - wait(.08); - - + wait(.15); + box1 = 0; + box2 = 0; box3 = 0; - - - //Wait until box completely opens then trigger pneumatics - wait(.7); - pneumatics1 = 1; - pneumatics2 = 0; - - //Wait until cylinder has finished travel - wait(.8); - pneumatics1 = 0; - pneumatics2 = 1; + wait(1.5); + //Cylinders Up + pn1 = 1; + pn2 = 0; + wait(1); + //Cylinders Down + pn1 = 0; + pn2 = 1; wait(.5); - pneumatics2 =0; - - //Wait to full retract then repeat - wait(5); + //Cylinders Off + pn1 =0; + pn2 =0; + //Wait to repeat + wait(2); count++; - setLCDpos(2,1); - lcd.printf("%d",count); - + //setLCDpos(2,1); + //lcd.printf("%d",count); + pc.printf("%d",count); } else { check = 0; } - setLCDpos(3,1); - lcd.printf("%d", check); + //setLCDpos(3,1); + //lcd.printf("%d", check); } }