Skip to content

Commit

Permalink
Merge branch 'main' into create-drivetrain
Browse files Browse the repository at this point in the history
  • Loading branch information
FRCTeam3255-Shared-K1-10 committed Oct 19, 2024
2 parents 3862e17 + 1fc537c commit 334e8d0
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/java/frc/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,15 @@ public static class mapDriveTrain {
public static final int FRONT_LEFT_MOTOR = 2;
public static final int BACK_LEFT_MOTOR = 3;
}
}

public static class mapIntake {
public static final int TOP_MOTOR_CAN = 20;
public static final int BOTTOM_MOTOR_CAN = 21;
}

public static class mapHopper {
public static final int HOPPER_MOTOR = 30;
public static final int GAME_PIECE_HOPPER_DIO = 1;
}

}
36 changes: 36 additions & 0 deletions src/main/java/frc/robot/subsystems/Hopper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// 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.subsystems;

import com.ctre.phoenix6.hardware.TalonFX;

import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.RobotMap;

public class Hopper extends SubsystemBase {
/** Creates a new Hopper. */
TalonFX HopperMotor;
DigitalInput HopperSensor;

public Hopper() {
HopperMotor = new TalonFX(RobotMap.mapHopper.HOPPER_MOTOR);
HopperSensor = new DigitalInput(RobotMap.mapHopper.GAME_PIECE_HOPPER_DIO);

}

public void setHopperMotorSpeed(double speed) {
HopperMotor.set(speed);
}

public void setHopperMotorNuetralOutput() {
HopperMotor.set(0);
}

@Override
public void periodic() {

}
}
26 changes: 26 additions & 0 deletions src/main/java/frc/robot/subsystems/Intake.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.subsystems;

import com.ctre.phoenix6.hardware.TalonFX;

import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.RobotMap;

public class Intake extends SubsystemBase {
/** Creates a new Intake. */
TalonFX topMotor;
TalonFX bottomMotor;

public Intake() {
topMotor = new TalonFX(RobotMap.mapIntake.TOP_MOTOR_CAN);
bottomMotor = new TalonFX(RobotMap.mapIntake.BOTTOM_MOTOR_CAN);
}

@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

0 comments on commit 334e8d0

Please sign in to comment.