![]() |
Motor Programming
Okay - I want to have a motor that - when button 4 is pressed on the joystick the motor moves in one direction until he button is released - when button 5 is pressed the motor moves in the other direction until the button is released.
Here is the code I wrote: Subsystem for the "ForkMotor": Quote:
Command to move motor in one direction. Quote:
Quote:
THANKS for the help! |
Re: Motor Programming
In the constructor for each of your commands, you should pass the instance variable from CommandBase instead of the Subsystem class name:
Code:
public LiftForks() {Code:
public LiftForks() { |
Re: Motor Programming
My Subsystem name is the same as the name in commandbase.
I did not end the command because I will use the button.whileHeld(new command) and should it shut the motor/command down when I release the button so I don't have to tell it to stop. Right now I am not having any issues with it - I haven't been able to test it though because I am having DS issues. THANKS! |
Re: Motor Programming
Quote:
Code:
ForkMotor forkMotor = new ForkMotor();Quote:
Code:
public class ForkMotor extends Subsystem {Code:
public class LiftForks extends CommandBase { |
Re: Motor Programming
Okay - yeah your right - THANKS a ton!
|
| All times are GMT -5. The time now is 22:34. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi