summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-03-13 09:14:47 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-03-13 09:14:47 -0400
commit28552a1bb8104f6ef0a8d9360fdb6562efc27578 (patch)
treeb2fe99f48b511fd47fac449c9bd34ac386e0f8f2
parent9c425fc33c6d579b448ecebf8c3003ad13ad2013 (diff)
saturday
-rw-r--r--src/org/usfirst/frc/team4272/robot2016/Autonomous.java15
-rw-r--r--src/org/usfirst/frc/team4272/robot2016/HwRobot.java4
-rw-r--r--src/org/usfirst/frc/team4272/robot2016/Teleop.java4
3 files changed, 18 insertions, 5 deletions
diff --git a/src/org/usfirst/frc/team4272/robot2016/Autonomous.java b/src/org/usfirst/frc/team4272/robot2016/Autonomous.java
index 1d61448..756c33d 100644
--- a/src/org/usfirst/frc/team4272/robot2016/Autonomous.java
+++ b/src/org/usfirst/frc/team4272/robot2016/Autonomous.java
@@ -1,20 +1,33 @@
package org.usfirst.frc.team4272.robot2016;
+import edu.wpi.first.wpilibj.Timer;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
public class Autonomous {
+ private final Timer time = new Timer();
private final HwRobot robot;
public Autonomous(HwRobot robot) {
this.robot = robot;
+ time.reset();
+ time.start();
}
public Control run(Control c) {
if (robot.armL.get()) {
- c.arm = -0.2;
+ c.arm = -0.5;
} else {
c.arm = 0;
robot.armE.reset();
}
+ if (time.get() < 4) {
+ c.lDrive1 = c.rDrive1 = -0.4;
+ } else {
+ c.lDrive1 = c.rDrive1 = 0;
+ }
+ SmartDashboard.putNumber("autoTime", time.get());
+
return c;
}
}
diff --git a/src/org/usfirst/frc/team4272/robot2016/HwRobot.java b/src/org/usfirst/frc/team4272/robot2016/HwRobot.java
index 7d63f86..71b13ed 100644
--- a/src/org/usfirst/frc/team4272/robot2016/HwRobot.java
+++ b/src/org/usfirst/frc/team4272/robot2016/HwRobot.java
@@ -33,7 +33,7 @@ public class HwRobot {
private final PIDOutput rDriveM1 = new Talon(/*PWM*/2), rDriveM2 = new Talon(/*PWM*/4);
private final PIDOutput armM = new Talon(/*PWM*/8);
private final PIDOutput fBallM = new PIDOutputSplitter(new Talon(/*PWM*/9), new Talon(/*PWM*/3));
- private final PIDOutput bBallM = new PIDOutputSplitter(new Talon(/*PWM*/6), new Talon(/*PWM*/7));
+ private final PIDOutput bBallM = new Talon(/*PWM*/6);
public final Encoder armE = new Encoder(/*DIO*/0, /*DIO*/1, /*DIO*/2, true);
public final DigitalInput armL = new DigitalInput(/*DIO*/3);
@@ -52,7 +52,7 @@ public class HwRobot {
lDriveM2.pidWrite( c.lDrive2);
rDriveM1.pidWrite(-c.rDrive1);
rDriveM2.pidWrite(-c.rDrive2);
- armM.pidWrite(c.arm);
+ armM.pidWrite(c.arm * 0.5);
fBallM.pidWrite(-c.fBall);
bBallM.pidWrite(-c.bBall);
diff --git a/src/org/usfirst/frc/team4272/robot2016/Teleop.java b/src/org/usfirst/frc/team4272/robot2016/Teleop.java
index 19dfc6e..56e2dc7 100644
--- a/src/org/usfirst/frc/team4272/robot2016/Teleop.java
+++ b/src/org/usfirst/frc/team4272/robot2016/Teleop.java
@@ -39,8 +39,8 @@ public class Teleop {
double bBall = bound(-1, fBall, 0) + oneIf(oi.xbox.getButton(Button.A)) - oneIf(oi.xbox.getButton(Button.B));
boolean ballL = robot.ballL.get();
- control.fBall = bound(-oneIf(ballL), fBall, 1);
- control.bBall = bound(-oneIf(ballL), bBall < 0 ? 0.75*bBall : bBall, 1);
+ control.fBall = bound(-oneIf(ballL), fBall < 0 ? 0.75*fBall : fBall, 1);
+ control.bBall = bound(-oneIf(ballL), bBall < 0 ? 0.85*bBall : bBall, 1);
/* I'm eyeballing 10 degrees ≈ 50 clicks */
if (robot.armE.pidGet() < 50 && !robot.armL.get()) {