|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Motor Moving While Set To Zero
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: Code:
public class OI {
public JoystickButton rollersIn;
public OI() {
rollersIn = new JoystickButton(rotateStick, 1);
rollersIn.toggleWhenPressed(new RollersInCommand());
}
Code:
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();
}
}
Code:
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);
}
}
|
|
#2
|
||||||
|
||||||
|
Re: Motor Moving While Set To Zero
What is the LED on the Talon doing when it is moving slowly?
|
|
#4
|
||||
|
||||
|
Re: Motor Moving While Set To Zero
The light is slowly flashing red.
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|