diff --git a/src/main/java/frc/robot/commands/ServoCommands.java b/src/main/java/frc/robot/commands/ServoCommands.java index 8c0946d..b6b28a8 100644 --- a/src/main/java/frc/robot/commands/ServoCommands.java +++ b/src/main/java/frc/robot/commands/ServoCommands.java @@ -2,6 +2,7 @@ package frc.robot.commands; import frc.robot.Constants; +import frc.robot.Robot; import frc.robot.RobotContainer; import frc.robot.subsystems.Servo; import frc.robot.subsystems.XRPDrivetrain; @@ -26,11 +27,17 @@ public class ServoCommands { public static Command servoAdjustAngleCommand(double adjustAmount) { return new RunCommand( () -> RobotContainer.m_servo.adjustAngleBy(adjustAmount) - //() -> frc.robot.subsystems.Servo.m_armServo.adjustAngleBy() or maybe RobotContainer.m_servo - //note to self: if hiIhopeThisWorks doesn't work, then do ^^^ and change m_armServo to public + //AdjustAngleBy code is in Servo.java: m_armServo.setAngle(adjustAmount+m_armServo.getAngle()) + ); } + public static Command servoAdjustAngleCommandOnce(double adjustAmount) { + return new InstantCommand( + () -> RobotContainer.m_servo.adjustAngleBy(adjustAmount) + ); + } + public static Command servoSetAngleCommand(double angle) { return new InstantCommand( () -> RobotContainer.m_servo.setAngle(angle) diff --git a/src/main/java/frc/robot/subsystems/Servo.java b/src/main/java/frc/robot/subsystems/Servo.java index b7387a1..567d4e5 100644 --- a/src/main/java/frc/robot/subsystems/Servo.java +++ b/src/main/java/frc/robot/subsystems/Servo.java @@ -23,4 +23,8 @@ public void adjustAngleBy(double adjustAmount) { //makes the current angle larger or smaller by adjusting angle by adjustAmount m_armServo.setAngle(adjustAmount+m_armServo.getAngle()); } + + public double getAngle() { + return(m_armServo.getAngle()); + } }