Quote:
Originally Posted by Oblarg
I don't see any Scheduler.run() call in your teleop periodic code. Without that, there is nothing to call the commands that you have assigned to buttons.
|
This is the most likely cause of the problem. I would create a second project just to see what the default code does.
In the teleopPeriodic() method, you are creating Button objects then calling the whenPressed() methods. Next, the teleopPeriodic() ends and those objects go away (Garbage Collected). While this might work (I have not tested) if you add the Scheduler.run() call, it is a waste of time and effort for the roboRio.
Instead, I would recommend making the Button objects as member fields (just move the Button button1 ... ; statement outside of all methods) and moving the whenPressed() method calls to teleopInit(). Don't forget to add back the call to Scheduler.run()!