Quote:
Originally Posted by Mark McLeod
I think this does what you ask for one button.
However, adding a second button can bring some additional complexity to handle pressing both buttons at once and avoiding letting the release of one of them from trying to engage the brake with the other button is still powering the elevator.
It has two separate elements.
The hold the button action happens in Teleop.vi
The Disengage/Engage brake happens in Periodic Tasks (this can also be implemented using a state machine).
The important point is that the joystick can be checked and acted on anywhere as many times as you need.
In the Periodic Tasks example, one action must complete before the other action can occur, but you might want to restructure it a little to force an Engage to only follow a Disengage and vice versa. For the Periodic Tasks segment, I'd probably nest the Engage behind the Disengage in such a way that you cannot have two Engages or Disengages in a row.
When adding Button B you'll have to be careful that the motors do not get two conflicting orders at the same time.
In adding Button B to the Teleop code you'll have to use Selects to prioritize one button over the other.
|
What is the wait 20 for in the bottom left corner?