Created
April 22, 2018 14:37
-
-
Save GaganBhat/e64476c7b9ed5c256613572febfad156 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package frc.team2220.robot.commands.auto; | |
import edu.wpi.first.wpilibj.command.Command; | |
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | |
import frc.team2220.robot.Robot; | |
public class VelocityTester extends Command { | |
public VelocityTester() { | |
requires(Robot.twilightDrive); | |
} | |
// Called just before this Command runs the first time | |
@Override | |
protected void initialize() { | |
Robot.twilightDrive.lDriveMaster.setProfile(1); | |
Robot.twilightDrive.rDriveMaster.setProfile(1); | |
Robot.twilightDrive.changeToVelocity(); | |
} | |
// Called repeatedly when this Command is scheduled to run | |
@Override | |
protected void execute() { | |
Robot.twilightDrive.driveSet(300, 300); | |
SmartDashboard.putNumber("LEFT VELOCITY", Robot.twilightDrive.lDriveMaster.getEncVelocity()); | |
SmartDashboard.putNumber("RIGHT VELOCITY", Robot.twilightDrive.rDriveMaster.getEncVelocity()); | |
} | |
// Make this return true when this Command no longer needs to run execute() | |
@Override | |
protected boolean isFinished() { | |
return false; | |
} | |
// Called once after isFinished returns true | |
@Override | |
protected void end() { | |
} | |
// Called when another command which requires one or more of the same | |
// subsystems is scheduled to run | |
@Override | |
protected void interrupted() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment