Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Controlling two subsystems with one controller (http://www.chiefdelphi.com/forums/showthread.php?t=113598)

inkspell4 15-02-2013 21:51

Controlling two subsystems with one controller
 
For out shooter and loading mechanism we are using a single xbox controller. It seems thought that if a single button activates a method that takes time to complete that any other method cannot interrupt when it is activated by a button that is on the same controller.

Is there any way to fix this?

inkspell4 16-02-2013 19:35

Is each controller only able to have one command running that was activated by a single controller at a time.

gixxy 16-02-2013 20:22

Re: Controlling two subsystems with one controller
 
I was using three commands at once yesterday with an Xbox Controller. (Running Launch Motors with a While Held, Firing a piston using a timeout, and running a second motor with a while held). I know this is possible.

Our Code: https://github.com/frc3946/UltimateAscent

Are you using any Timer.delay()'s in your code? That would cause the entire robot thread to wait.

For further help please post your code.

Ty Tremblay 16-02-2013 20:47

Re: Controlling two subsystems with one controller
 
Controllers are just used to start/trigger commands. If you can't interrupt commands, then your commands must not be implemented correctly. Could you post the code for the command that cannot be interrupted?

inkspell4 16-02-2013 21:03

To be more specific we are using whenPressed to control a subsystem for each of the bumpers on the controller each one activating a different subsystem.

When one is pressed and the method is running the other will not run. The second method is not linked to the first.

While this is going on the drive train still works although it is controlled by a separate set of joysticks.


All times are GMT -5. The time now is 10:14.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi