diff --git a/src/org/usfirst/frc/team2059/robot/.OI.java.swp b/src/org/usfirst/frc/team2059/robot/.OI.java.swp new file mode 100644 index 0000000..e3fb45d Binary files /dev/null and b/src/org/usfirst/frc/team2059/robot/.OI.java.swp differ diff --git a/src/org/usfirst/frc/team2059/robot/.Robot.java.swp b/src/org/usfirst/frc/team2059/robot/.Robot.java.swp new file mode 100644 index 0000000..ff23d84 Binary files /dev/null and b/src/org/usfirst/frc/team2059/robot/.Robot.java.swp differ diff --git a/src/org/usfirst/frc/team2059/robot/OI.java b/src/org/usfirst/frc/team2059/robot/OI.java index b0353af..9d4ecf7 100644 --- a/src/org/usfirst/frc/team2059/robot/OI.java +++ b/src/org/usfirst/frc/team2059/robot/OI.java @@ -24,6 +24,7 @@ public class OI { } // Print log when button 1 pressed joystickButtons[0][0].whenPressed(new LogEncoder()); +// joystickButtons[1][0].whenPressed(new } public Joystick[] getJoysticks() { return joysticks; diff --git a/src/org/usfirst/frc/team2059/robot/RobotMap.java b/src/org/usfirst/frc/team2059/robot/RobotMap.java index 7d09e23..ece7714 100644 --- a/src/org/usfirst/frc/team2059/robot/RobotMap.java +++ b/src/org/usfirst/frc/team2059/robot/RobotMap.java @@ -1,10 +1,10 @@ package org.usfirst.frc.team2059.robot; public class RobotMap { //Drive - public static int driveLeftMotorOne = 0; - public static int driveLeftMotorTwo = 1; - public static int driveRightMotorOne = 2; - public static int driveRightMotorTwo = 3; + public static int driveLeftMotorOne = 1; + public static int driveLeftMotorTwo = 2; + public static int driveRightMotorOne = 3; + public static int driveRightMotorTwo = 4; public static int driveRightEncoder = 0; public static int driveLeftEncoder = 1; //Arm diff --git a/src/org/usfirst/frc/team2059/robot/commands/.CommandBase.java.swp b/src/org/usfirst/frc/team2059/robot/commands/.CommandBase.java.swp new file mode 100644 index 0000000..2e36ad4 Binary files /dev/null and b/src/org/usfirst/frc/team2059/robot/commands/.CommandBase.java.swp differ diff --git a/src/org/usfirst/frc/team2059/robot/commands/.Drive.java.swp b/src/org/usfirst/frc/team2059/robot/commands/.Drive.java.swp new file mode 100644 index 0000000..1628b40 Binary files /dev/null and b/src/org/usfirst/frc/team2059/robot/commands/.Drive.java.swp differ diff --git a/src/org/usfirst/frc/team2059/robot/commands/.MoveArm.java.swp b/src/org/usfirst/frc/team2059/robot/commands/.MoveArm.java.swp new file mode 100644 index 0000000..f74b8a7 Binary files /dev/null and b/src/org/usfirst/frc/team2059/robot/commands/.MoveArm.java.swp differ diff --git a/src/org/usfirst/frc/team2059/robot/commands/CommandBase.java b/src/org/usfirst/frc/team2059/robot/commands/CommandBase.java index 14edec0..9800578 100644 --- a/src/org/usfirst/frc/team2059/robot/commands/CommandBase.java +++ b/src/org/usfirst/frc/team2059/robot/commands/CommandBase.java @@ -1,13 +1,16 @@ package org.usfirst.frc.team2059.robot.commands; import org.usfirst.frc.team2059.robot.subsystems.DriveBase; import org.usfirst.frc.team2059.robot.subsystems.EncoderBase; +import org.usfirst.frc.team2059.robot.subsystems.MainArm; import edu.wpi.first.wpilibj.command.Command; public abstract class CommandBase extends Command { protected static EncoderBase encoderBase; protected static DriveBase driveBase; + protected static MainArm mainArm; public static void init() { encoderBase = new EncoderBase(); driveBase = new DriveBase(); + mainArm = new MainArm(); } } // vim: sw=2:ts=2:sts=2 diff --git a/src/org/usfirst/frc/team2059/robot/commands/MoveArm.java b/src/org/usfirst/frc/team2059/robot/commands/MoveArm.java new file mode 100644 index 0000000..9c5a0f7 --- /dev/null +++ b/src/org/usfirst/frc/team2059/robot/commands/MoveArm.java @@ -0,0 +1,32 @@ +package org.usfirst.frc.team2059.robot.commands; +import org.usfirst.frc.team2059.robot.commands.CommandBase; +import org.usfirst.frc.team2059.robot.Robot; +/** + * + */ +public class MoveArm extends CommandBase { + double speed; + public MoveArm(double s) { + requires(mainArm); + speed=s; + } + // Called just before this Command runs the first time + protected void initialize() { + } + // Called repeatedly when this Command is scheduled to run + protected void execute() { + mainArm.moveArm(speed); + } + // Make this return true when this Command no longer needs to run execute() + protected boolean isFinished() { + return true; + } + // 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() { + } +} +// vim: sw=2:ts=2:sts=2 diff --git a/src/org/usfirst/frc/team2059/robot/subsystems/.DriveBase.java.swp b/src/org/usfirst/frc/team2059/robot/subsystems/.DriveBase.java.swp new file mode 100644 index 0000000..97b1e6f Binary files /dev/null and b/src/org/usfirst/frc/team2059/robot/subsystems/.DriveBase.java.swp differ diff --git a/src/org/usfirst/frc/team2059/robot/subsystems/.MainArm.java.swp b/src/org/usfirst/frc/team2059/robot/subsystems/.MainArm.java.swp new file mode 100644 index 0000000..d3c5a5b Binary files /dev/null and b/src/org/usfirst/frc/team2059/robot/subsystems/.MainArm.java.swp differ diff --git a/src/org/usfirst/frc/team2059/robot/subsystems/DriveBase.java b/src/org/usfirst/frc/team2059/robot/subsystems/DriveBase.java index b3cf9cc..d4a1453 100644 --- a/src/org/usfirst/frc/team2059/robot/subsystems/DriveBase.java +++ b/src/org/usfirst/frc/team2059/robot/subsystems/DriveBase.java @@ -2,12 +2,12 @@ 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.Talon; +import edu.wpi.first.wpilibj.CANTalon; public class DriveBase extends Subsystem { - Talon leftMotorOne = new Talon(RobotMap.driveLeftMotorOne); - Talon leftMotorTwo = new Talon(RobotMap.driveLeftMotorTwo); - Talon rightMotorOne = new Talon(RobotMap.driveRightMotorOne); - Talon rightMotorTwo = new Talon(RobotMap.driveRightMotorTwo); + CANTalon leftMotorOne = new CANTalon(RobotMap.driveLeftMotorOne); + CANTalon leftMotorTwo = new CANTalon(RobotMap.driveLeftMotorTwo); + CANTalon rightMotorOne = new CANTalon(RobotMap.driveRightMotorOne); + CANTalon rightMotorTwo = new CANTalon(RobotMap.driveRightMotorTwo); public void initDefaultCommand() { setDefaultCommand(new Drive()); } diff --git a/src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java b/src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java new file mode 100644 index 0000000..54e9c9b --- /dev/null +++ b/src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java @@ -0,0 +1,17 @@ +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 MainArm extends Subsystem { + CANTalon armMotorLeft = new CANTalon(RobotMap.armLeftMotor); + CANTalon armMotorRight = new CANTalon(RobotMap.armRightMotor); + public void initDefaultCommand() { + setDefaultCommand(new Drive()); + } + public void moveArm(double speed){ + armMotorLeft.set(speed); + armMotorRight.set(-speed); + } +} +// vim: sw=2:ts=2:sts=2