|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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;
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| closed-loop torque (current) wheel control for mecanum | Ether | Programming | 3 | 07-02-2010 00:54 |
| Radio Packet loss + closed loop control system = lunging robot | Dave K. | Control System | 5 | 20-02-2007 06:09 |
| control loop frequency. | Rickertsen2 | Programming | 1 | 12-01-2006 08:38 |
| PID control loops - closed loop feedback | KenWittlief | Technical Discussion | 56 | 26-04-2004 21:27 |
| PID control loop/Encoder question | Zee | Programming | 18 | 30-01-2004 23:14 |