Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Fix loop for control (http://www.chiefdelphi.com/forums/showthread.php?t=83229)

EthanMiller 20-02-2010 21:35

Fix loop for control
 
For running the kicker, I need to have some delays. However, I also need the program to respond to driver input during this. My current code (Selection below) has to pause for the completion of the kick.

I'm not sure how to do it. Thanks for any help!

Code:

if (lastState == false && m_otherStick.getTrigger() == true) {
    trigger.set(Relay.Value.kForward);
    Timer.delay(1.1);
    Watchdog.getInstance().feed();
    trigger.set(Relay.Value.kOff);
    trigger.set(Relay.Value.kReverse);
    Watchdog.getInstance().feed();
    Timer.delay(1);
    trigger.set(Relay.Value.kOff);
    shoot.set(true); retract.set(false);
    Watchdog.getInstance().feed();
    Timer.delay(.4);
    shoot.set(false); retract.set(true);
    lastState = true;
} else if (lastState == true && m_otherStick.getTrigger() == false) {
    lastState = false;
}



All times are GMT -5. The time now is 09:26.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi