blob: 5cba22f6c2cbbd6ea8ec61eff8b588348f14ab25 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
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 (time.get() < 5) {
// c.lDrive1 = c.lDrive2 = 0.2;
// c.rDrive1 =c.rDrive2 = -0.2;
// } else {
// c.lDrive1 = c.rDrive1 = 0;
// c.lDrive2 = c.rDrive2 = 0;
// }
if(Math.abs(robot.driveE.getRaw()) > 1){
c.lDrive1 = c.lDrive2 = 0;
c.rDrive1 =c.rDrive2 = 0;
}
else
{
c.lDrive1 = c.lDrive2 = 0.2;
c.rDrive1 =c.rDrive2 = 0.2;
}
SmartDashboard.putNumber("autoTime", time.get());
return c;
}
}
|