Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.

Commit 334e8d0

Browse files
Merge branch 'main' into create-drivetrain
2 parents 3862e17 + 1fc537c commit 334e8d0

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

src/main/java/frc/robot/RobotMap.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,15 @@ public static class mapDriveTrain {
1919
public static final int FRONT_LEFT_MOTOR = 2;
2020
public static final int BACK_LEFT_MOTOR = 3;
2121
}
22-
}
22+
23+
public static class mapIntake {
24+
public static final int TOP_MOTOR_CAN = 20;
25+
public static final int BOTTOM_MOTOR_CAN = 21;
26+
}
27+
28+
public static class mapHopper {
29+
public static final int HOPPER_MOTOR = 30;
30+
public static final int GAME_PIECE_HOPPER_DIO = 1;
31+
}
32+
33+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) FIRST and other WPILib contributors.
2+
// Open Source Software; you can modify and/or share it under the terms of
3+
// the WPILib BSD license file in the root directory of this project.
4+
5+
package frc.robot.subsystems;
6+
7+
import com.ctre.phoenix6.hardware.TalonFX;
8+
9+
import edu.wpi.first.wpilibj.DigitalInput;
10+
import edu.wpi.first.wpilibj2.command.SubsystemBase;
11+
import frc.robot.RobotMap;
12+
13+
public class Hopper extends SubsystemBase {
14+
/** Creates a new Hopper. */
15+
TalonFX HopperMotor;
16+
DigitalInput HopperSensor;
17+
18+
public Hopper() {
19+
HopperMotor = new TalonFX(RobotMap.mapHopper.HOPPER_MOTOR);
20+
HopperSensor = new DigitalInput(RobotMap.mapHopper.GAME_PIECE_HOPPER_DIO);
21+
22+
}
23+
24+
public void setHopperMotorSpeed(double speed) {
25+
HopperMotor.set(speed);
26+
}
27+
28+
public void setHopperMotorNuetralOutput() {
29+
HopperMotor.set(0);
30+
}
31+
32+
@Override
33+
public void periodic() {
34+
35+
}
36+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) FIRST and other WPILib contributors.
2+
// Open Source Software; you can modify and/or share it under the terms of
3+
// the WPILib BSD license file in the root directory of this project.
4+
5+
package frc.robot.subsystems;
6+
7+
import com.ctre.phoenix6.hardware.TalonFX;
8+
9+
import edu.wpi.first.wpilibj2.command.SubsystemBase;
10+
import frc.robot.RobotMap;
11+
12+
public class Intake extends SubsystemBase {
13+
/** Creates a new Intake. */
14+
TalonFX topMotor;
15+
TalonFX bottomMotor;
16+
17+
public Intake() {
18+
topMotor = new TalonFX(RobotMap.mapIntake.TOP_MOTOR_CAN);
19+
bottomMotor = new TalonFX(RobotMap.mapIntake.BOTTOM_MOTOR_CAN);
20+
}
21+
22+
@Override
23+
public void periodic() {
24+
// This method will be called once per scheduler run
25+
}
26+
}

0 commit comments

Comments
 (0)