View Single Post
  #1   Spotlight this post!  
Unread 20-02-2010, 21:35
EthanMiller EthanMiller is offline
Lead Programmer
AKA: Socks
FTC #4356 (The Zip Ties)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Clayton, NY
Posts: 121
EthanMiller has a spectacular aura aboutEthanMiller has a spectacular aura aboutEthanMiller has a spectacular aura about
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;
}
__________________
When all else fails, read the manual.

FRC 1713 K Island Gears 2009, 2010 (Not 2011 due to budget, hopefully 2012!) - Fingerlakes Regional

FTC 4356 The Zip Ties 2010-2011 Season - NNYRC (2010 9th seed).
Reply With Quote