diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-02-28 15:46:48 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-02-28 15:46:48 -0500 |
commit | 81585537acee6e6642615fc9b5ddc14e49535f0b (patch) | |
tree | 9c3d3ec055f1974f5f6fe7a04822d8495ab5340d /src/org/usfirst/frc/team4272/robot2015/Autonomous.java | |
parent | 2fd56d5789e4bad4aaacda1133191491367f66dd (diff) |
Clean up
Diffstat (limited to 'src/org/usfirst/frc/team4272/robot2015/Autonomous.java')
-rw-r--r-- | src/org/usfirst/frc/team4272/robot2015/Autonomous.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/org/usfirst/frc/team4272/robot2015/Autonomous.java b/src/org/usfirst/frc/team4272/robot2015/Autonomous.java new file mode 100644 index 0000000..5d48588 --- /dev/null +++ b/src/org/usfirst/frc/team4272/robot2015/Autonomous.java @@ -0,0 +1,25 @@ +package org.usfirst.frc.team4272.robot2015; + +import edu.wpi.first.wpilibj.Timer; + +public class Autonomous { + private final Timer time = new Timer(); + private final HwRobot robot; + + public Autonomous(HwRobot robot) { + this.robot = robot; + time.reset(); + time.start(); + robot.rDriveE.reset(); + robot.lDriveE.reset(); + } + + public Control run(Control c) { + if (robot.rDriveE.getDistance() < (15.5*140*1.1)) { + c.rDrive = c.lDrive = -0.7; + } else { + c.rDrive = c.lDrive = 0; + } + return c; + } +} |