Hello I am programming in Java code and I was wondering if anyone knew of a way you can brake the motors in the code. For example, could I set the motors to coast during auto and brake during teleop. I know you can do this using the REV Robotics software but I didn’t know if you could with the code. Again we are programming with Java.
If you are connecting via CAN, yes. The SPARK MAX CAN interface to the NEO allows you to switch between brake and coast mode. Over PWM, no. See the SPARK MAX manual for details.
http://www.revrobotics.com/sparkmax-users-manual/
If using CAN, in your code, you can say sparkMax.setIdleMode(mode), where mode can either be IdleMode.kCoast, or IdleMode.kBrake
1 Like
Thank you it worked!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.