Skip to content

Commit

Permalink
Tank drive tutorial code
Browse files Browse the repository at this point in the history
  • Loading branch information
rcahoon committed Feb 9, 2024
1 parent 22a1817 commit 45b0b05
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/main/java/com/team766/robot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,15 @@ public OI() {
}

public void run(final Context context) {
context.takeOwnership(Robot.drive);
while (true) {
// wait for driver station data (and refresh it using the WPILib APIs)
context.waitFor(() -> RobotProvider.instance.hasNewDriverStationData());
RobotProvider.instance.refreshDriverStationData();

// Add driver controls here - make sure to take/release ownership
// of mechanisms when appropriate.
log("J0 A0: " + joystick0.getAxis(0) +
" J0 A1: " + joystick0.getAxis(1) +
" J1 A0: " + joystick1.getAxis(0) +
" J1 A1: " + joystick1.getAxis(1) +
" J0 B1: " + joystick0.getButton(1) +
" J0 B2: " + joystick0.getButton(2) +
" J0 B3: " + joystick0.getButton(3));
Robot.drive.setDrivePower(joystick0.getAxis(1), joystick1.getAxis(1));
}
}
}

0 comments on commit 45b0b05

Please sign in to comment.