Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Changes to tankDrive #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public void tankDrive(double leftPower, double rightPower) {
// to
// the value of leftPower:
frontLeft.set(leftPower);
frontRight.set(rightPower);

}
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ public void execute() {
// Get values from the joysticks:
// Here's how to get how far the left joystick's Y-axis is pushed:
double leftValue = operatorInterface.gamepad.getLeftVector().y;
// You'll need to get how far the RIGHT joystick's Y-axis is pushed as well.
double rightValue = operatorInterface.gamepad.getRightVector().y;
// You'll need to get how far the RIGHT joystick's Y-axis is pushed as well
returnVal(leftValue);
returnVal(rightValue);

// Pass values into the DriveSubsystem so it can control motors:
// right now, this just sends the left power to the left part of the drive.
// You'll
// need to give it a right power as well.
drive.tankDrive(leftValue, 0);
drive.tankDrive(leftValue, rightValue);
}

public double returnVal(double val){
return val;
}
}
Loading