-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRobot.java
63 lines (45 loc) · 1.14 KB
/
Robot.java
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package org.usfirst.frc.team2637.robot;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj.GenericHID.Hand;
public class Robot extends IterativeRobot {
public static XboxController xbox;
public static DriveTrain driveTrain;
final int DRIVE_XBOX_PORT = 0;
@Override
public void robotInit() {
xbox = new XboxController(DRIVE_XBOX_PORT);
driveTrain = new DriveTrain();
}
@Override
public void autonomousInit() {
}
@Override
public void autonomousPeriodic() {
}
@Override
public void teleopPeriodic() {
//Put this in arcadeDrive parameter if you want trigger method
//xbox.getTriggerAxis(Hand.kRight) - xbox.getTriggerAxis(Hand.kLeft), xbox.getX(Hand.kLeft)
driveTrain.arcadeDrive(xbox.getY(Hand.kLeft), xbox.getX(Hand.kRight));
/*
if(xbox.getAButton()) {
driveTrain.setHighGear();
}
if(xbox.getBButton()) {
driveTrain.setLowGear();
}*/
}
@Override
public void testPeriodic() {
}
@Override
public void robotPeriodic() {
}
@Override
public void disabledInit() {
}
@Override
public void disabledPeriodic() {
}
}