mirror of
https://github.com/Team4388/To-Shoot-TShirt.git
synced 2026-06-09 00:38:05 -06:00
Merge branch 'master' of https://github.com/Team4388/Shoot-To-TShirt
This commit is contained in:
@@ -39,4 +39,9 @@ public final class Constants {
|
||||
public static final int XBOX_DRIVER_ID = 0;
|
||||
public static final int XBOX_OPERATOR_ID = 1;
|
||||
}
|
||||
|
||||
public static final class HornConstants {
|
||||
public static final int HORN_SOLENOID_ID = 0;
|
||||
//Todo: Change ID with new id on the robot
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
||||
import frc4388.robot.Constants.*;
|
||||
import frc4388.robot.subsystems.Drive;
|
||||
import frc4388.robot.subsystems.Horn;
|
||||
import frc4388.robot.subsystems.LED;
|
||||
import frc4388.utility.LEDPatterns;
|
||||
import frc4388.utility.controller.IHandController;
|
||||
@@ -35,6 +36,8 @@ public class RobotContainer {
|
||||
m_robotMap.leftBackMotor, m_robotMap.rightBackMotor, m_robotMap.driveTrain, m_robotMap.gyroDrive);
|
||||
|
||||
private final LED m_robotLED = new LED(m_robotMap.LEDController);
|
||||
|
||||
private final Horn m_robotHorn = new Horn(m_robotMap.HornSolenoid);
|
||||
|
||||
/* Controllers */
|
||||
private final XboxController m_driverXbox = new XboxController(OIConstants.XBOX_DRIVER_ID);
|
||||
@@ -72,6 +75,11 @@ public class RobotContainer {
|
||||
new JoystickButton(getOperatorJoystick(), XboxController.A_BUTTON)
|
||||
.whenPressed(() -> m_robotLED.setPattern(LEDPatterns.LAVA_RAINBOW))
|
||||
.whenReleased(() -> m_robotLED.setPattern(LEDConstants.DEFAULT_PATTERN));
|
||||
|
||||
// BWAHHHHHHHHHHHH
|
||||
new JoystickButton(getOperatorJoystick(), XboxController.RIGHT_TRIGGER_AXIS)
|
||||
.whenPressed(() -> m_robotHorn.hornSet(true))
|
||||
.whenReleased(() -> m_robotHorn.hornSet(false));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,9 +12,11 @@ import com.ctre.phoenix.motorcontrol.NeutralMode;
|
||||
import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX;
|
||||
import com.ctre.phoenix.sensors.PigeonIMU;
|
||||
|
||||
import edu.wpi.first.wpilibj.Solenoid;
|
||||
import edu.wpi.first.wpilibj.Spark;
|
||||
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
||||
import frc4388.robot.Constants.DriveConstants;
|
||||
import frc4388.robot.Constants.HornConstants;
|
||||
import frc4388.robot.Constants.LEDConstants;
|
||||
import frc4388.utility.RobotGyro;
|
||||
|
||||
@@ -68,4 +70,6 @@ public class RobotMap {
|
||||
leftBackMotor.setInverted(InvertType.FollowMaster);
|
||||
rightBackMotor.setInverted(InvertType.FollowMaster);
|
||||
}
|
||||
|
||||
public final Solenoid HornSolenoid = new Solenoid(HornConstants.HORN_SOLENOID_ID);
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ public class Horn extends SubsystemBase {
|
||||
/**
|
||||
* Creates a new Horn.
|
||||
*/
|
||||
public Horn() {
|
||||
m_solenoid = new Solenoid(0);
|
||||
public Horn(Solenoid solenoid) {
|
||||
m_solenoid = solenoid;
|
||||
}
|
||||
|
||||
public void hornset(boolean arg) {
|
||||
public void hornSet(boolean arg) {
|
||||
m_solenoid.set(arg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user