Log in

View Full Version : Motor Moving While Set To Zero


Joey1939
08-02-2014, 18:12
We have a motor connected to a talon. In our code the Talon should always be set to full speed forwards/backwards or zero/off. Moving the motor forward or backwards works perfectly, but whenever the motor should be set to zero/off, it continues to move backwards slowly. Any insight would be greatly appreciated.

Here is part of the code for reference:

public class OI {
public JoystickButton rollersIn;

public OI() {
rollersIn = new JoystickButton(rotateStick, 1);
rollersIn.toggleWhenPressed(new RollersInCommand());
}



public class RollersInCommand extends Command {
public RollersInCommand() {
requires(Robot.arm);
}

protected void initialize() {
Robot.arm.rollersIn();
}

protected void execute() {
}

protected boolean isFinished() {
return false;
}

protected void interrupted() {
Robot.arm.rollersStop();
}
}



public class Arm extends Subsystem {
SpeedController motor = RobotMap.armmotor;

public void initDefaultCommand() {
}

public void rollersIn(){
motor.set(-1.0);
}

public void rollersOut(){
motor.set(1.0);
}

public void rollersStop(){
motor.set(0.0);
}
}

Joe Ross
08-02-2014, 18:21
What is the LED on the Talon doing when it is moving slowly?

heuristics
08-02-2014, 21:19
Try calibrating your Talon (http://www.crosstheroadelectronics.com/Talon_User_Manual_1_1.pdf).

Joey1939
09-02-2014, 12:42
What is the LED on the Talon doing when it is moving slowly?

The light is slowly flashing red.

Try calibrating your Talon (http://www.crosstheroadelectronics.com/Talon_User_Manual_1_1.pdf).

Okay. Thank you. I think that this will probably fix it.