more gamepadissues

This commit is contained in:
sihan 2024-03-04 11:00:04 -06:00
parent 58bbd69a21
commit b226da8137
2 changed files with 6 additions and 7 deletions

View File

@ -1,7 +1,6 @@
package org.firstinspires.ftc.teamcode.hardware; package org.firstinspires.ftc.teamcode.hardware;
import static org.firstinspires.ftc.robotcore.external.BlocksOpModeCompanion.gamepad1; import static org.firstinspires.ftc.robotcore.external.BlocksOpModeCompanion.gamepad1;
import static org.firstinspires.ftc.robotcore.external.BlocksOpModeCompanion.gamepad2;
import static org.firstinspires.ftc.teamcode.util.Configurables.ARMACCSCORE; import static org.firstinspires.ftc.teamcode.util.Configurables.ARMACCSCORE;
import static org.firstinspires.ftc.teamcode.util.Configurables.ARMPICKUPSTACK; import static org.firstinspires.ftc.teamcode.util.Configurables.ARMPICKUPSTACK;
import static org.firstinspires.ftc.teamcode.util.Configurables.ARMREST; import static org.firstinspires.ftc.teamcode.util.Configurables.ARMREST;
@ -70,8 +69,8 @@ public class Robot {
@Getter @Getter
private Slides slides; private Slides slides;
GamepadEx controller2 = new GamepadEx(gamepad2); // GamepadEx controller2 = new GamepadEx(gamepad2);
GamepadEx controller1 = new GamepadEx(gamepad1); // GamepadEx controller1 = new GamepadEx(gamepad1);
public Robot init(HardwareMap hardwareMap) { public Robot init(HardwareMap hardwareMap) {
@ -326,7 +325,7 @@ public class Robot {
public void pickupMacro(GamepadEx gamepadEx, double runtime) { public void pickupMacro(GamepadEx gamepadEx, double runtime) {
switch (pickupMacroState) { switch (pickupMacroState) {
case IDLE: case IDLE:
if (controller2.wasJustPressed(GamepadKeys.Button.DPAD_DOWN)){ if (gamepadEx.wasJustPressed(GamepadKeys.Button.DPAD_DOWN)){
pickupMacroState = pickupMacroStates.OPEN; pickupMacroState = pickupMacroStates.OPEN;
} }
break; break;

View File

@ -16,8 +16,8 @@ public class MainTeleOp extends OpMode {
this.robot = new Robot().init(hardwareMap); this.robot = new Robot().init(hardwareMap);
} }
GamepadEx controller2 = new GamepadEx(gamepad2); GamepadEx controller2 = new GamepadEx(this.gamepad2);
GamepadEx controller1 = new GamepadEx(gamepad1); GamepadEx controller1 = new GamepadEx(this.gamepad1);
public void loop() { public void loop() {
@ -28,7 +28,7 @@ public class MainTeleOp extends OpMode {
// boolean hangPlane = gamepad2.y; // boolean hangPlane = gamepad2.y;
// boolean plane = gamepad2.dpad_right; // boolean plane = gamepad2.dpad_right;
//Drive //Drive
robot.getDrive().setInput(controller1, controller2); robot.getDrive().setInput(this.controller1, this.controller2);
//slides //slides
// if (slideUp) { // if (slideUp) {
// this.robot.getSlides().slideUp(); // this.robot.getSlides().slideUp();