Go to Post Never mind the imperial British Empire, the sun never sets on our FIRST season! - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 08-02-2014, 18:12
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 139
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
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);
    }
}
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:46.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi