From c92ec8653432445677527ba4ab9f80dc53fd254f Mon Sep 17 00:00:00 2001 From: MorphaxTheDeveloper Date: Thu, 7 Mar 2024 15:46:15 +0300 Subject: [PATCH] =?UTF-8?q?intake=20at=C4=B1s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/RobotContainer.java | 5 +++++ .../robot/commands/Intake/PidIntakeCommand.java | 2 +- .../frc/robot/subsystems/IntakeSubsystem.java | 15 ++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 63817bb..33d599a 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -70,10 +70,13 @@ private void configureBindings() { new JoystickButton(driverJoytick, 10).whileFalse(new InstantCommand(()->m_shooter.ShooterThrowAllMotorStop())); new JoystickButton(driverJoytick, 1).whileTrue(new dalhacan(m_intake, m_shooter)); + new JoystickButton(driverJoytick, 1).whileTrue(new InstantCommand(()->m_intake.degistirmee())); new JoystickButton(driverJoytick, 3).whileTrue(new ShooterSetDegree(m_shooter, 160.0)); //new JoystickButton(driverJoytick, 4).whileTrue(new cinarcan(m_intake, m_feeder)); new JoystickButton(driverJoytick, 4).whileTrue(new PidIntakeCommand(m_intake, 1.2)); + new JoystickButton(driverJoytick, 4).whileTrue(new InstantCommand(()-> m_intake.degistir())); new JoystickButton(driverJoytick, 1).whileFalse(new InstantCommand(()->m_intake.StopAngleMotor())); + new JoystickButton(driverJoytick, 2).whileTrue(new InstantCommand(()->m_intake.reset())); new JoystickButton(driverJoytick, 2).whileTrue(new InstantCommand(()->m_shooter.AngleEncoderReset())); @@ -93,6 +96,8 @@ private void configureBindings() { new JoystickButton(driverJoytick, 6).whileFalse(new InstantCommand(()-> m_feeder.stop())); new JoystickButton(driverJoytick, 8).whileTrue(new InstantCommand(()-> m_intake.runpickupmotor(0.8))); new JoystickButton(driverJoytick, 8).whileFalse(new InstantCommand(()-> m_intake.runpickupmotor(0))); + new JoystickButton(driverJoytick, 10).whileTrue(new InstantCommand(()-> m_feeder.backward())); + new JoystickButton(driverJoytick, 10).whileFalse(new InstantCommand(()-> m_feeder.stop())); } diff --git a/src/main/java/frc/robot/commands/Intake/PidIntakeCommand.java b/src/main/java/frc/robot/commands/Intake/PidIntakeCommand.java index 387f66f..c34dd00 100644 --- a/src/main/java/frc/robot/commands/Intake/PidIntakeCommand.java +++ b/src/main/java/frc/robot/commands/Intake/PidIntakeCommand.java @@ -26,7 +26,7 @@ public PidIntakeCommand(IntakeSubsystem m_intake, double position) { else if (position < -m_intake.getRawEncoderOutput()) { m_intake.NewIntakeMotorOutput(-output * 0.8); } - + }); addRequirements(m_intake); getController().setTolerance(Constants.values.intake.PidIntakeTolerance); diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 8fd70d9..ba356f1 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -57,15 +57,18 @@ public void getNote(){ public void degistir(){ -tekcalisma = true; +tekcalisma = false; } +public void degistirmee(){ +tekcalisma = true; +} - public void runpickupmotorswitch(double a){ - + public void runpickupmotorswitch(double a){ +if(tekcalisma){ while((intakedetector1.get() && intakedetector2.get())){ intakeMotor1.set(a); } @@ -73,6 +76,12 @@ public void runpickupmotorswitch(double a){ intakeMotor1.set(0); } + + +} + + +