![]() |
Command Based Programming
Im assuming that the command based programming is more even based programming. Create a command, associate it to a JoystickButton and when the button is clicked, the command is run.
I have put printlns in all methods, and am clicking the joystickbutton but nothing is printing. I have even ran the start on the command, but it is not getting into the execute, or initialize for that matter. I have also added it to a group and started the group, but nothing. Ideas? |
Re: Command Based Programming
Could you post your code?
Alex Brinister |
Re: Command Based Programming
If you wrote the code by hand (rather than RobotBuilder generated) make sure that you are calling Scheduler.run() in the TeleopPeriodic method like this:
Code:
public void teleopPeriodic() { |
Re: Command Based Programming
Would I need to do that with the iterative robot code?
|
Re: Command Based Programming
stick to command based its much easier to manage.
|
Re: Command Based Programming
But if I was going to use iterative would I need the
Code:
Scheduler.getInstance().run(); |
Re: Command Based Programming
Command based programming is based off of iterative. Instead of putting your code in the xxxPeriodic() methods, you call "Scheduler.getInstance().run();" in them and put your code in commands.
Look at the command based example to see how this is supposed to be done. |
| All times are GMT -5. The time now is 03:41. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi