added drivebase subsystem and blank command

This commit is contained in:
Adam Long 2016-07-19 18:19:20 +00:00
parent 9f6eeacb8e
commit cb6be490a4
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,33 @@
package org.usfirst.frc.team2059.robot.commands;
import edu.wpi.first.wpilibj.command.Command;
/**
*
*/
public class Drive extends Command {
public Drive() {
}
// Called just before this Command runs the first time
protected void initialize() {
}
// Called repeatedly when this Command is scheduled to run
protected void execute() {
}
// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return false;
}
// Called once after isFinished returns true
protected void end() {
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
}
}

View File

@ -0,0 +1,27 @@
package org.usfirst.frc.team2059.robot.subsystems;
import org.usfirst.frc.team2059.robot.RobotMap;
import org.usfirst.frc.team2059.robot.commands.Drive;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.CANTalon;
public class Drivebase extends Subsystem {
CANTalon leftMotorOne = new CANTalon(RobotMap.driveLeftMotorOne);
CANTalon leftMotorTwo = new CANTalon(RobotMap.driveLeftMotorTwo);
CANTalon rightMotorOne = new CANTalon(RobotMap.driveRightMotorOne);
CANTalon rightMotorTwo = new CANTalon(RobotMap.driveRightMotorOne);
public void initDefaultCommand() {
setDefaultCommand(new Drive());
}
public void driveArcade(double x, double y, double z, double sensitivity){
leftMotorOne.set(-y+(x+z));
leftMotorTwo.set(-y+(x+z));
rightMotorOne.set(y+(x+z));
rightMotorTwo.set(y+(x+z));
}
}