The Spectrum build thread mentioned being able to set a motor controller mode (brake/coast) using a joystick button after the match ends.
Does anyone know how this witchcraft is done in LabView with a Spark Max?
The Spectrum build thread mentioned being able to set a motor controller mode (brake/coast) using a joystick button after the match ends.
Does anyone know how this witchcraft is done in LabView with a Spark Max?
The SPARK MAXs will need to be on the CAN bus if they aren’t already. This is all you need to set a motor controller to coast:
You can throw it in Disabled.vi (or Periodic Tasks.vi, which will let it work in teleop as well) and read the joystick the same way you normally would. Disabling the robot just prevents motors/pneumatics from actuating; they can still be configured, and joystick data is still sent (unlike autonomous).
If you always want the motor controller to go to coast after match end, you could do this in Disabled.vi:
You could also run it after a set amount of time if it’s to let a climber drop for easier robot retrieval.
Regardless, it’s important to remember that SPARK MAXs retain their control mode. If you do something like this, be sure to also set the mode to brake in Begin.vi so that they always set back when the robot boots (or, alternatively, on the first runs of autonomous and teleop so that they always set back on enable; this might be more practical for practicing).
Thanks for the clear explanation!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.