From 6f9c9bb2f6484e219ddccd1459716fbfc61181e6 Mon Sep 17 00:00:00 2001 From: Abhi <90010729+Abhishrek05@users.noreply.github.com> Date: Tue, 24 Jan 2023 17:04:19 -0700 Subject: [PATCH] claw done --- .../java/frc4388/robot/subsystems/Arm.java | 6 ++-- .../java/frc4388/robot/subsystems/Claw.java | 30 +++++++++++-------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/main/java/frc4388/robot/subsystems/Arm.java b/src/main/java/frc4388/robot/subsystems/Arm.java index ea5aa8e..8da4852 100644 --- a/src/main/java/frc4388/robot/subsystems/Arm.java +++ b/src/main/java/frc4388/robot/subsystems/Arm.java @@ -1,7 +1,9 @@ +package frc4388.robot.subsystems; + public class Arm { // Moves arm to distence [dist] then returns new ang - public int funtion moveArm(int dist) { + public int moveArm(int dist) { // Move arm code - return newDist; + return 0; } } \ No newline at end of file diff --git a/src/main/java/frc4388/robot/subsystems/Claw.java b/src/main/java/frc4388/robot/subsystems/Claw.java index eae54e4..37793b1 100644 --- a/src/main/java/frc4388/robot/subsystems/Claw.java +++ b/src/main/java/frc4388/robot/subsystems/Claw.java @@ -1,17 +1,23 @@ -public class claw { +package frc4388.robot.subsystems; +import edu.wpi.first.wpilibj.PWM; + +public class Claw { + private PWM m_clawMotor; + private boolean m_open = false; + // Opens claw - public void funtion openClaw() { + public Claw(PWM m_clawMotor) { + this.m_clawMotor = m_clawMotor; + setClaw(true); + } + + public void setClaw(boolean open) { // Open claw + m_open = open; + m_clawMotor.setRaw(open ? 0 : 2000); } - // Closes claw - public void function closeClaw() { - //Close claw - } - - // Rotate wrist - public int function rotClaw(int rot) { - //Rotate wrist to ROT - return newRot; - } + public boolean isClawOpen() { + return m_open; + } } \ No newline at end of file