summaryrefslogtreecommitdiff
path: root/src/org/usfirst/frc/team4272/robot2016/HwRobot.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/usfirst/frc/team4272/robot2016/HwRobot.java')
-rw-r--r--src/org/usfirst/frc/team4272/robot2016/HwRobot.java55
1 files changed, 36 insertions, 19 deletions
diff --git a/src/org/usfirst/frc/team4272/robot2016/HwRobot.java b/src/org/usfirst/frc/team4272/robot2016/HwRobot.java
index e61d87f..4555adf 100644
--- a/src/org/usfirst/frc/team4272/robot2016/HwRobot.java
+++ b/src/org/usfirst/frc/team4272/robot2016/HwRobot.java
@@ -9,8 +9,11 @@ import edu.wpi.first.wpilibj.PIDOutput;
import edu.wpi.first.wpilibj.PIDSourceType;
import edu.wpi.first.wpilibj.PowerDistributionPanel;
import edu.wpi.first.wpilibj.Talon;
+import edu.wpi.first.wpilibj.Jaguar;
+import edu.wpi.first.wpilibj.Solenoid;
import org.usfirst.frc.team4272.robotlib.PIDOutputSplitter;
+import org.usfirst.frc.team4272.robotlib.PIDServo;
public class HwRobot {
/* Relay == a Spike */
@@ -33,16 +36,18 @@ public class HwRobot {
// naming convention: {side_letter}{Thing}{E|M (encoder/motor)}
private final PIDOutput
- rDriveM1 = new Talon(/*PWM*/2), /* PDP 2, 3 */
- rDriveM2 = new Talon(/*PWM*/4), /* PDP 4 */
+ rDriveM1 = new Talon(/*PWM*/0), /* PDP 2, 3 */
+ climber = new Talon(/*PWM*/3), /* PDP 4 */
lDriveM1 = new Talon(/*PWM*/1), /* PDP 12, 13 */
- lDriveM2 = new Talon(/*PWM*/0), /* PDP 11 */
- armM = new Talon(/*PWM*/8), /* PDP 15 */
- rfBallM = new Talon(/*PWM*/3), /* PDP 0 */
- lfBallM = new Talon(/*PWM*/9), /* PDP 14 */
- fBallM = new PIDOutputSplitter(rfBallM, lfBallM),
- bBallM = new Talon(/*PWM*/6); /* PDP 10, 5 */
-
+ //lDriveM2 = new Talon(3),/*PWM*/ /* PDP 11 */
+ //rDriveM2 = new Talon(1),
+ //armM = new Talon(/*PWM*/8), /* PDP 15 */
+ //rfBallM = new Talon(/*PWM*/4), /* PDP 0 */
+ //lfBallM = new Talon(/*PWM*/9), /* PDP 14 */
+ //fBallM = new PIDOutputSplitter(rfBallM, lfBallM),
+ //bBallM = new Talon(/*PWM*/6),/* PDP 10, 5 */
+ camRotate = new PIDServo(8),
+ camTilt = new PIDServo(9);
public final Encoder armE = new Encoder(/*DIO*/0, /*DIO*/1, /*DIO*/2, true);
public final DigitalInput armL = new DigitalInput(/*DIO*/3);
public final DigitalInput ballL = new DigitalInput(/*DIO*/4);
@@ -50,22 +55,33 @@ public class HwRobot {
public final Encoder lDriveE = new Encoder(/*DIO*/7,/*DIO*/8, true);
public final PowerDistributionPanel PDP = new PowerDistributionPanel(); /* via CAN */
+ public Solenoid PCM = new Solenoid(/*PCM*/ 4);
+ public Solenoid PCM2 = new Solenoid(5);
+ public Solenoid PCM3 = new Solenoid(6);
+ public Solenoid PCM4 = new Solenoid(7);
+
public HwRobot() {
armE.setPIDSourceType(PIDSourceType.kDisplacement);
lDriveE.setPIDSourceType(PIDSourceType.kRate);
rDriveE.setPIDSourceType(PIDSourceType.kRate);
- PDP.initTable(NetworkTable.getTable("PDP"));
+ //PDP.initTable(NetworkTable.getTable("PDP"));//
}
public void run(Control c) {
lDriveM1.pidWrite( c.lDrive1);
- lDriveM2.pidWrite( c.lDrive2);
- rDriveM1.pidWrite(-c.rDrive1);
- rDriveM2.pidWrite(-c.rDrive2);
- armM.pidWrite(c.arm * 0.5);
- fBallM.pidWrite(-c.fBall);
- bBallM.pidWrite(-c.bBall);
-
+ rDriveM1.pidWrite(c.rDrive1);
+ //lDriveM2.pidWrite( c.lDrive2);
+ climber.pidWrite(c.climber);
+ //rDriveM2.pidWrite(-c.rDrive2);
+ //armM.pidWrite(c.arm * 0.5);
+ //fBallM.pidWrite(-c.fBall);
+ //bBallM.pidWrite(-c.bBall);
+ camRotate.pidWrite(c.camRotate);
+ camTilt.pidWrite(c.camTilt);
+ PCM.set(c.PCM);
+ PCM2.set(c.PCM2);
+ PCM3.set(c.PCM3);
+ PCM4.set(c.PCM4);
SmartDashboard.putNumber("fBall", c.fBall);
SmartDashboard.putNumber("bBall", c.bBall);
SmartDashboard.putNumber("armM", c.arm);
@@ -78,7 +94,8 @@ public class HwRobot {
SmartDashboard.putBoolean("ballL", ballL.get());
SmartDashboard.putBoolean("armL", armL.get());
- PDP.updateTable();
- SmartDashboard.putData("PDP", PDP);
+ //PDP.updateTable();**//
+ //SmartDashboard.putData("PDP", PDP);//
}
+
}