View Full Version : Commands immediately canceling
Team3205
15-02-2014, 17:20
Hello, we have a command which runs a motor until a switch has been pressed. We want this functionality for another subsystem. We copy pasted the code from the first subsystem into the second subsystem changing ports names etc. We have buttons on smartdashboard which activate certain commands. When the first command is started it works fine. When the copyed command is started it automatically cancels. We have even tried making it so that the isFinished method always returns false but it still cancels instantly. Does anyone know what the problem might be?
AllenGregoryIV
15-02-2014, 17:54
Please post part of your code, it's much harder to debug if we can't see it.
Do either command require a subsystem?
Team3205
16-02-2014, 09:25
16249
Here is a zip file of all our code, specifically the areas where we are having this problem is the SuckBalls command, even though it looks identical to the Reload command. Thanks for any help.
Andrew Lobos
16-02-2014, 09:48
Are you sure ballsucker.isSwitchSet() in isFinished() is returning what you think it is? If some electrical issue is making that always return true, your function will end after the first loop.
Besides going in with a multimeter, you can just throw a System.out.println(ballsucker.isSwitchSet()); in and see what the cRIO is getting. Logging to SmartDashboard could also get the job done
Team3205
16-02-2014, 09:55
Fixed it thanks for your help!
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.