|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
Re: Command Based Programming
Could you post your code?
Alex Brinister |
|
#3
|
|||
|
|||
|
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() {
Scheduler.getInstance().run();
}
|
|
#4
|
|||
|
|||
|
Re: Command Based Programming
Would I need to do that with the iterative robot code?
|
|
#5
|
|||
|
|||
|
Re: Command Based Programming
stick to command based its much easier to manage.
|
|
#6
|
|||
|
|||
|
Re: Command Based Programming
But if I was going to use iterative would I need the
Code:
Scheduler.getInstance().run(); |
|
#7
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|