Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 50bda32
Author: Isha290411 <[email protected]>
Date:   Thu Oct 24 19:46:29 2024 -0500

    refactored the lift code

    made sure it would work

commit 2ec1302
Author: Isha290411 <[email protected]>
Date:   Thu Oct 24 18:10:03 2024 -0500

    Update RobotAutoDriveByGyro_Linear.java
  • Loading branch information
rhsftc committed Oct 25, 2024
1 parent 9fd8ae9 commit c5b695b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ public void runOpMode() {
leftBackDrive.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
leftFrontDrive.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
rightBackDrive.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
leftFrontDrive.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
rightFrontDrive.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);

leftBackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
leftFrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
rightBackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public class RobotHardware {
public DcMotor rightFrontDrive = null;
public DcMotor rightBackDrive = null;

public DcMotorEx liftMotor = null;
public DcMotorEx liftMotor = null; //5203 series, 384.5 ppr - encoder resolution
//5204-08139 series, 3895.9 resolution, for other arm thing motor

// Define a constructor that allows the OpMode to pass a reference to itself.
public RobotHardware(LinearOpMode opMode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Lift(RobotHardware robot) {
public void init() {
liftPosition = LiftPosition.Down;
liftState = liftPosition;
// Make sure encoder is 0 at start.
// Make sure encoder is 0 at start
robot.liftMotor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
robot.liftMotor.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
}
Expand Down Expand Up @@ -74,9 +74,9 @@ public void update() {
liftState = LiftPosition.Down;
}
}
break;
break;
default:
// If we get here we have problem, stop the lift.
// if get here, there is a problem
robot.liftMotor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
robot.liftMotor.setPower(0);
liftState = LiftPosition.Down;
Expand Down

0 comments on commit c5b695b

Please sign in to comment.