|
Creating a "delay" for a boolean value
Hey everyone, I am a programmer for team 3019 and have a quick question...
Here is the setup. Our kicker works like this. A cylinder pushes a kicker into its locked state, and a servo locks it into place. The cylinder then recedes. (this process is automatic)There is a limit switch to tell the program when it is in its locked state, which then tells it to activate the servo and pull in the cylinder. The problem is that as soon as the limit switch is activate, the cylinder recedes at the same time as the servo latches, and it does not latch fast enough.
So my question is, how can I create a delay for the cylinder, so the servo latches and after x amount of time the cylinder recedes?
The first thing I tried was creating a case structure right before solenoid fire. If the incoming boolean was false (the solenoid is going to retreat) I used a watchdog delay and feed (for the errors i used solenoid open to fire). This works, but it delays the entire robot, and I think logically it would constantly be delayed when the solenoid is not firing. Is there a better way to create this kind of delay?
Last edited by masterspy7 : 21-02-2010 at 01:51.
|