|
Re: help with timed function
You have two options to add this to teleop.
One approach is to use a state machine directly in teleop code. You add a shift register or a global or other state data to remember that the code needs to do something in the future. Each time through, you check the state data to see if it is time to do the deed. When done, you clear it.
The other approach is that you put the code to close the solenoid somewhere else that is always running, like in Periodic Tasks. It mostly sleeps, but occasionally wakes up to see if you are telling it to do something. When you open the solenoid, you set a global telling it when to close the solenoid.
Greg McKaskle
|