Quote:
Originally Posted by notmattlythgoe
The simplest way to do this for now would be to have it check the switch on start up and initialize the buttons one way or another. You wouldn't be able to switch it on the fly with the robot on, but with a restart you could switch back and forth.
|
I was trying to avoid rebooting the robot to switch the controls. I was not 100% sure that I would be able to do it on the fly like this but wanted to give it a try. If the WPILib is polling (i.e. periodically dereferencing them to check some property) those Button objects then I can see how messing with them at runtime could cause it to crash. As you can probably tell I didn't take the time to dig into the WPILib implementation on this and my plan was to just test it out and see if it worked..if not then go to what you suggested and check the switch on startup.
Can you be more specific as to what your reasoning is for why it won't work?