diff --git a/src/org/usfirst/frc/team4737/robot/RobotMap.java b/src/org/usfirst/frc/team4737/robot/RobotMap.java index 530c2d8..d3b6232 100644 --- a/src/org/usfirst/frc/team4737/robot/RobotMap.java +++ b/src/org/usfirst/frc/team4737/robot/RobotMap.java @@ -14,12 +14,23 @@ * floating around. */ public class RobotMap { - // For example to map the left and right motors, you could define the - // following variables to use with your drivetrain subsystem. - public static int leftDriveMaster = 1; - public static int leftDriveSlave = 2; - public static int rightDriveMaster = 3; - public static int rightDriveSlave = 4; + + // Drivetrain + + public static int DRIVE_LEFT_MASTER = 11; + public static int DRIVE_LEFT_SLAVE = 12; + public static int DRIVE_RIGHT_MASTER = 13; + public static int DRIVE_RIGHT_SLAVE = 14; + + // Intake + + public static final int INTAKE_LEFT = 15; + public static final int INTAKE_RIGHT = 16; + + // Elevator + + public static final int ELEVATOR_MOTOR_A = 17; + public static final int ELEVATOR_MOTOR_B = 18; // If you are using multiple modules, make sure to define both the port // number and the module. For example you with a rangefinder: diff --git a/src/org/usfirst/frc/team4737/robot/subsystems/Climber.java b/src/org/usfirst/frc/team4737/robot/subsystems/Climber.java index 727c089..896678c 100644 --- a/src/org/usfirst/frc/team4737/robot/subsystems/Climber.java +++ b/src/org/usfirst/frc/team4737/robot/subsystems/Climber.java @@ -15,10 +15,10 @@ public class Climber extends Subsystem { public Climber() { // TODO when we know how the climber works #BlameMechanical } - + public void initDefaultCommand() { // Set the default command for a subsystem here. // setDefaultCommand(new MySpecialCommand()); } - + } diff --git a/src/org/usfirst/frc/team4737/robot/subsystems/Drivetrain.java b/src/org/usfirst/frc/team4737/robot/subsystems/Drivetrain.java index f3e10e4..3e358c1 100644 --- a/src/org/usfirst/frc/team4737/robot/subsystems/Drivetrain.java +++ b/src/org/usfirst/frc/team4737/robot/subsystems/Drivetrain.java @@ -11,38 +11,39 @@ */ public class Drivetrain extends Subsystem { - // Put methods for controlling this subsystem - // here. Call these from Commands. + // Put methods for controlling this subsystem + // here. Call these from Commands. private WPI_TalonSRX leftFrontMaster; private WPI_TalonSRX rightFrontMaster; private WPI_TalonSRX leftBackSlave; private WPI_TalonSRX rightBackSlave; - + public Drivetrain() { - leftFrontMaster = new WPI_TalonSRX(RobotMap.leftDriveMaster); - leftBackSlave = new WPI_TalonSRX(RobotMap.leftDriveSlave); - rightFrontMaster = new WPI_TalonSRX(RobotMap.rightDriveMaster); - rightBackSlave = new WPI_TalonSRX(RobotMap.rightDriveSlave); - + leftFrontMaster = new WPI_TalonSRX(RobotMap.DRIVE_LEFT_MASTER); + leftBackSlave = new WPI_TalonSRX(RobotMap.DRIVE_LEFT_SLAVE); + rightFrontMaster = new WPI_TalonSRX(RobotMap.DRIVE_RIGHT_MASTER); + rightBackSlave = new WPI_TalonSRX(RobotMap.DRIVE_RIGHT_SLAVE); + leftBackSlave.follow(leftFrontMaster); rightBackSlave.follow(rightFrontMaster); } - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); - } - - /** - * Controls the drivetrain using two tank-drive joystick inputs - * - * @param leftInput - Left joystick input from -1.0 to 1.0 - * @param rightInput - Right joystick input from -1.0 to 1.0 - */ - public void tankDrive(double leftInput, double rightInput) { - leftFrontMaster.set(leftInput); - rightFrontMaster.set(rightInput); - } - -} + public void initDefaultCommand() { + // Set the default command for a subsystem here. + // setDefaultCommand(new MySpecialCommand()); + } + /** + * Controls the drivetrain using two tank-drive joystick inputs + * + * @param leftInput + * - Left joystick input from -1.0 to 1.0 + * @param rightInput + * - Right joystick input from -1.0 to 1.0 + */ + public void tankDrive(double leftInput, double rightInput) { + leftFrontMaster.set(leftInput); + rightFrontMaster.set(rightInput); + } + +} diff --git a/src/org/usfirst/frc/team4737/robot/subsystems/Elevator.java b/src/org/usfirst/frc/team4737/robot/subsystems/Elevator.java index 83c65ea..6d2a7a4 100644 --- a/src/org/usfirst/frc/team4737/robot/subsystems/Elevator.java +++ b/src/org/usfirst/frc/team4737/robot/subsystems/Elevator.java @@ -1,5 +1,7 @@ package org.usfirst.frc.team4737.robot.subsystems; +import org.usfirst.frc.team4737.robot.RobotMap; + import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; import edu.wpi.first.wpilibj.command.Subsystem; @@ -9,15 +11,19 @@ */ public class Elevator extends Subsystem { - // Put methods for controlling this subsystem - // here. Call these from Commands. - - private WPI_TalonSRX elevatorMotor; - private WPI_TalonSRX elevatorSpool; + // Put methods for controlling this subsystem + // here. Call these from Commands. - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); - } -} + private WPI_TalonSRX motorA; + private WPI_TalonSRX motorB; + public Elevator() { + motorA = new WPI_TalonSRX(RobotMap.ELEVATOR_MOTOR_A); + motorB = new WPI_TalonSRX(RobotMap.ELEVATOR_MOTOR_B); + } + + public void initDefaultCommand() { + // Set the default command for a subsystem here. + // setDefaultCommand(new MySpecialCommand()); + } +} diff --git a/src/org/usfirst/frc/team4737/robot/subsystems/Intake.java b/src/org/usfirst/frc/team4737/robot/subsystems/Intake.java index f98255b..d23ab9a 100644 --- a/src/org/usfirst/frc/team4737/robot/subsystems/Intake.java +++ b/src/org/usfirst/frc/team4737/robot/subsystems/Intake.java @@ -1,5 +1,7 @@ package org.usfirst.frc.team4737.robot.subsystems; +import org.usfirst.frc.team4737.robot.RobotMap; + import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; import edu.wpi.first.wpilibj.command.Subsystem; @@ -9,17 +11,19 @@ */ public class Intake extends Subsystem { - // Put methods for controlling this subsystem - // here. Call these from Commands. - - private WPI_TalonSRX clawLeft; - private WPI_TalonSRX clawRight; - - - - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); - } -} + // Put methods for controlling this subsystem + // here. Call these from Commands. + + private WPI_TalonSRX leftMotor; + private WPI_TalonSRX rightMotor; + public Intake() { + leftMotor = new WPI_TalonSRX(RobotMap.INTAKE_LEFT); + rightMotor = new WPI_TalonSRX(RobotMap.INTAKE_RIGHT); + } + + public void initDefaultCommand() { + // Set the default command for a subsystem here. + // setDefaultCommand(new MySpecialCommand()); + } +}