From 6d929d18f276b24ef2b7ffc25c2afb06567f0806 Mon Sep 17 00:00:00 2001 From: FriedLongJohns <81837862+FriedLongJohns@users.noreply.github.com> Date: Sat, 30 Sep 2023 18:12:53 -0700 Subject: [PATCH] shorten functions --- .../carlmontrobotics/robotcode2023/subsystems/Arm.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/carlmontrobotics/robotcode2023/subsystems/Arm.java b/src/main/java/org/carlmontrobotics/robotcode2023/subsystems/Arm.java index 01571f57..056f06f1 100644 --- a/src/main/java/org/carlmontrobotics/robotcode2023/subsystems/Arm.java +++ b/src/main/java/org/carlmontrobotics/robotcode2023/subsystems/Arm.java @@ -128,14 +128,8 @@ public void periodic() { isWristEncoderConnected = currTime - lastMeasuredTime < DISCONNECTED_ENCODER_TIMEOUT_SEC; SmartDashboard.putBoolean("WristEncoderConnected", isWristEncoderConnected); - if(isArmEncoderConnected = false) - { - armMotor.stopMotor(); - } - if(isWristEncoderConnected = false) - { - wristMotor.stopMotor(); - } + if (!isArmEncoderConnected) armMotor.stopMotor(); + if (!isWristEncoderConnected) wristMotor.stopMotor(); //TODO: is RobotContainer live or do you need supplier functions armConstraints = new TrapezoidProfile.Constraints(