I’m trying to figure out the way to program pneumatics (in RobotC) using a latch system, so that when the driver pushes a button, the pneumatics activate and deactivate only when the button is pushed again. So far, I haven’t been very lucky.
If you know how to do this, your help is greatly appreciated!
A little bit unrelated, (but very, very important :p) have any of you used either PID or TBH code? I’m trying to optimize our launcher and would like to know how they have worked out for you, and which one is the most effective!
This is the way most people on the forum do it. It waits until the button is released before allowing the rest of the code to run. The other way requires saving the current button to a value and then only switching the state if the button is pushed AND it wasn’t pushed last time.