![]() |
Java Command Based Command
New to Command Based... We are about to start coding the commands for each subsystem and before we get too far, we need the following info on how to handle multiple commands...
For example, we have a feeder motor... we want a command to FeederOn(clockwise), FeederOnRev(counterclockwise) and FeederOff... We created a Feeder_Command class... Code:
public class TeleopFeederOn_Command extends Command{ |
Re: Java Command Based Command
If you want a button to execute a command you should be doing this in the OI class.
See here for an example: https://wpilib.screenstepslive.com/s...joystick-input Basically:
To specifically address your code example, get rid of everything except "Robot.fuelFeederSubsystem.FeederOn();" in the execute method. Then add something like the following to the OI class: Code:
Joystick myJoystick = new Joystick(0);The guides for command based programming on screensteps live are pretty good. You could also use RobotBuilder to generate some example code to see what the "right" way to do it is. And there's also lots of example code out there to pull from. |
| All times are GMT -5. The time now is 04:04. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi