Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Commit

Permalink
asdasdasd
Browse files Browse the repository at this point in the history
  • Loading branch information
MorphaxTheDeveloper committed Mar 6, 2024
1 parent b8c4635 commit 96354c1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import frc.robot.commands.Swerve.SwerveJoystickCmd;
import frc.robot.commands.common.FeedingPosition;
import frc.robot.commands.common.IntakeInputPosition;
import frc.robot.commands.common.dalhacan;
import frc.robot.subsystems.FeederSubsystem;
import frc.robot.subsystems.IntakeSubsystem;
import frc.robot.subsystems.ShooterSubsystem;
Expand Down Expand Up @@ -67,7 +68,7 @@ private void configureBindings() {

new JoystickButton(driverJoytick, 10).whileFalse(new InstantCommand(()->m_shooter.ShooterThrowAllMotorStop()));

new JoystickButton(driverJoytick, 1).whileTrue(new IntakeInputPosition(m_intake));
new JoystickButton(driverJoytick, 1).whileTrue(new dalhacan(m_intake, m_shooter));
new JoystickButton(driverJoytick, 3).whileTrue(new ShooterSetDegree(m_shooter, 160.0));
new JoystickButton(driverJoytick, 4).whileTrue(new FeedingPosition(m_shooter, m_feeder,m_intake));

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/commands/common/FeedingPosition.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public FeedingPosition(ShooterSubsystem m_shooter,FeederSubsystem m_feeder , Int

addCommands(
//1.8
new PidIntakeCommand(m_intake, 1.2)
.alongWith(new ShooterSetDegree(m_shooter, -1.15))
( new PidIntakeCommand(m_intake, 1.2)

//-3.8
.andThen(
new InstantCommand(()->m_feeder.runtillswitch()).alongWith(new InstantCommand(() -> m_intake.NewIntakeMotorOutput(0.4)))
//ShooterSetDegree(m_shooter, -1.15)



)


)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

public class IntakeInputPosition extends SequentialCommandGroup {
public IntakeInputPosition(IntakeSubsystem m_intake) {
addCommands(new PidIntakeCommand(m_intake, 11.0));
addCommands(new PidIntakeCommand(m_intake, 12.0));
}
}
26 changes: 26 additions & 0 deletions src/main/java/frc/robot/commands/common/dalhacan.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands.common;

import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.commands.Intake.PidIntakeCommand;
import frc.robot.subsystems.FeederSubsystem;
import frc.robot.subsystems.IntakeSubsystem;
import frc.robot.subsystems.ShooterSubsystem;

// NOTE: Consider using this command inline, rather than writing a subclass. For more
// information, see:
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
public class dalhacan extends SequentialCommandGroup {
/** Creates a new dalhacan. */
public dalhacan(IntakeSubsystem m_intake, ShooterSubsystem m_shooter) {
// Add your commands in the addCommands() call, e.g.
// addCommands(new FooCommand(), new BarCommand());
addCommands(
new InstantCommand(()->m_shooter.ShootertoFeederPos()).alongWith(new PidIntakeCommand(m_intake, 12.0)));

}
}
8 changes: 7 additions & 1 deletion src/main/java/frc/robot/subsystems/ShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ public void ShooterThrowAllMotorStop(){
public void ShooterAngleMotorStop(){
ShooterAngleMotor.set(0);
}

public void ShootertoFeederPos(){
if(!shooterswitch.get()){
ShooterAngleMotor.set(0.1);
}else{
ShooterAngleMotor.stopMotor();
}
}

@Override
public void periodic() {
Expand Down

0 comments on commit 96354c1

Please sign in to comment.