Kyle Zampaglione
/
GloveBoxTester
Code for testing glovebox.
GloveBoxTester.cpp
- Committer:
- kzampag
- Date:
- 2013-07-11
- Revision:
- 0:4c49d95a1f05
- Child:
- 1:f0943cae3bee
File content as of revision 0:4c49d95a1f05:
#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++; } }