Skip to content

Commit

Permalink
finished claw code and worked on code for robot harware
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobLillquist committed Nov 9, 2024
1 parent 32022a7 commit 44d52b1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import com.qualcomm.robotcore.util.ElapsedTime;

import org.firstinspires.ftc.teamcode.subsystems.Arm;
import org.firstinspires.ftc.teamcode.subsystems.Bucket;
import org.firstinspires.ftc.teamcode.subsystems.Claw;
import org.firstinspires.ftc.teamcode.subsystems.Lift;

/*
Expand All @@ -52,18 +54,25 @@ public class DriverControl extends LinearOpMode {
// Prefix any hardware functions with "robot." to access this class.
public RobotHardware robot = new RobotHardware(this);
private final Lift lift = new Lift(robot);
private final org.firstinspires.ftc.teamcode.subsystems.Arm arm = new Arm(robot);
private final Arm arm = new Arm(robot);
private final Claw claw = new Claw(robot);
private final Bucket bucket = new Bucket(robot);



// Use the new FtcLib gamepad extension.
GamepadEx gamepadOne = null;
GamepadEx gamepadTwo = null;

@Override
public void runOpMode() {
GamepadEx gamepadOne = new GamepadEx(gamepad1);
robot.init();
lift.init();
arm.init();
claw.init();
bucket.init();


// Wait for the game to start (driver presses START)
telemetry.addData("Status", "Initialized");
Expand All @@ -75,12 +84,15 @@ public void runOpMode() {
// run until the end of the match (driver presses STOP)
while (opModeIsActive()) {
gamepadOne.readButtons();
gamepadTwo.readButtons();

lift.setProperties(gamepadOne.wasJustPressed(GamepadKeys.Button.A),
gamepadOne.wasJustPressed(GamepadKeys.Button.X),
gamepadOne.wasJustPressed(GamepadKeys.Button.Y));

arm.setProperties(gamepadOne.wasJustPressed(GamepadKeys.Button.LEFT_BUMPER),
arm.setProperties(gamepadOne.wasJustPressed(GamepadKeys.Button.DPAD_DOWN),
gamepadOne.wasJustPressed(GamepadKeys.Button.DPAD_UP));
claw.setProperties(gamepadOne.wasJustPressed(GamepadKeys.Button.LEFT_BUMPER),
gamepadOne.wasJustPressed(GamepadKeys.Button.RIGHT_BUMPER));

// POV Mode uses left joystick to go forward & strafe, and right joystick to rotate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public void init() {
rightBackDrive.setDirection(DcMotor.Direction.REVERSE);

imu = myOpMode.hardwareMap.get(IMU.class, "imu");
clawServo = myOpMode.hardwareMap.get(Servo.class,"clawServo");
bucketServo = myOpMode.hardwareMap.get(Servo.class,"bucketServo");

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ public void update() {
}
}
}

public void setProperties(boolean leftBumper, boolean rightBumper) {
leftBumperPressed = leftBumper;
rightBumperPressed = rightBumper;
}
}

0 comments on commit 44d52b1

Please sign in to comment.