Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of GloveBoxTester by
GloveBoxTester.cpp
- Committer:
- kzampag
- Date:
- 2013-07-12
- Revision:
- 1:f0943cae3bee
- Parent:
- 0:4c49d95a1f05
- Child:
- 2:73be4f9f04f9
File content as of revision 1:f0943cae3bee:
#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(" \n \rHere 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(0.3);
pneumatics1 = 0;
pneumatics2 = 1;
//Wait to full retract then repeat
wait(0.3);
pc.printf("%d\r",count);
count++;
}
}
