Quote:
Originally Posted by Brandon
We also have a similar problem running our spike relays. When trying to control them by having one button run them forward and one in reverse, the light flickers and sounds can be heard that sound like shorting or arching.
|
This is a very specific symptom with an obvious (once you know it) cause.
Your first button is choosing whether to run the Spike forward or turn it off. Your second button is choosing whether to run the Spike reverse or turn it off. With a button pressed, those two choices are fighting each other. The Spike either gets turned on and then off again, or turned off and then on again, each time through Teleop.
What you can to do instead is to have the first button choose whether to run the Spike forward or ask the second button what it wants to do. The second button will have the opportunity to run the Spike reverse or turn it off, but only if the first button isn't already running it forward.
You can also do some funny math with the buttons, with the first button selecting a value of either 0 or +1 and the second selecting a value of either 0 or -1, then add them together. Use the sum as the selector of a three-way Case, with -1 setting the Spike reverse, +1 setting it forward, and 0 turning it off.