|
Re: On Button press, run a sequence (Not momentary!)
try something like this psuedocode, point being use an 'isActive' type boolean. If you're using labview, you'll have to look at this yourself, and find a similar concept (never used it)
bool solenoidRunning = false; //at init
//following in main loop
if (!solenoidRunning && buttonPressed){
solenoidRunning = true;
activateSolenoid();
} else if (solenoidRunning && switchActivated) {
stopSolenoid();
solenoidRunning = false;
}
Edit: Sorry, forgot to look at the forum category...
Last edited by compboy07 : 16-02-2012 at 23:46.
|