Kyle Zampaglione
/
GloveBoxTester
Code for testing glovebox.
Diff: GloveBoxTester.cpp
- Revision:
- 0:4c49d95a1f05
- Child:
- 1:f0943cae3bee
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GloveBoxTester.cpp Thu Jul 11 23:49:36 2013 +0000 @@ -0,0 +1,54 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX); +Serial lcd(p13,p14); + +DigitalOut pneumatics1(p11); +DigitalOut pneumatics2(p12); +DigitalOut box1(p23); +DigitalOut box2(p22); +DigitalOut box3(p21); + + +int count = 1; +int cycles = 10000; + + + + +int main() +{ + pc.printf("Here we go! \n \r"); + while(count< cycles) { + + + //Trigger solenoid + box1 = 1; + box2 = 1; + box3 = 1; + + //Turn off solenoid after .2 because they draw a lot of current + wait(0.2); + box1 = 0; + box2 = 0; + box3 = 0; + + //Wait until box completely opens then trigger pneumatics + wait(.5); + pneumatics1 = 1; + pneumatics2 = 0; + + //Wait until cylinder has finished travel + wait(.3); + pneumatics1 = 0; + pneumatics2 = 1; + + //Wait to full retract then repeat + wait(0.2); + + pc.printf("%d \n \r",count); + count++; + + + } +}