Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2024.1.1"
id "edu.wpi.first.GradleRIO" version "2024.2.1"
}

java {
Expand Down
43 changes: 43 additions & 0 deletions src/main/java/frc/robot/commands/RobotCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// 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;

import frc.robot.subsystems.IntakeSubsystem;
import edu.wpi.first.wpilibj2.command.Command;

/** An example command that uses an example subsystem. */
public class RobotCommand extends Command {
@SuppressWarnings({"PMD.UnusedPrivateField", "PMD.SingularField"})
private final IntakeSubsystem m_subsystem;

/**
* Creates a new ExampleCommand.
*
* @param subsystem The subsystem used by this command.
*/
public RobotCommand(IntakeSubsystem subsystem) {
m_subsystem = subsystem;
// Use addRequirements() here to declare subsystem dependencies.
addRequirements(subsystem);
}

// Called when the command is initially scheduled.
@Override
public void initialize() {}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {}

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {}

// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}
44 changes: 28 additions & 16 deletions src/main/java/frc/robot/subsystems/IntakeSubsystem.java
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
package frc.robot.subsystems;

import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.motorcontrol.MotorController;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import com.revrobotics.CANSparkMax;

import com.ctre.phoenix6.configs.CANcoderConfiguration;
import com.ctre.phoenix6.hardware.CANcoder;
import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.signals.AbsoluteSensorRangeValue;
import com.ctre.phoenix6.signals.SensorDirectionValue;
import edu.wpi.first.wpilibj2.command.SubsystemBase;

import com.revrobotics.CANSparkMax;
import com.revrobotics.RelativeEncoder;
import com.revrobotics.CANSparkLowLevel.MotorType;

public class IntakeSubsystem {

public class IntakeSubsystem extends SubsystemBase {
//PLACEHOLDER
private CANSparkMax intakeSensor;
private CANSparkMax inputMotor;
private CANSparkMax shooterMotor1;
private CANSparkMax shooterMotor2;

public void IntakeSubsytem(int inputMotorChannel, int sensorChannel, int shooterMotorChannel, int shooterMotorChannel2){

//PLACEHOLDER
intakeSensor = new CANSparkMax(sensorChannel, MotorType.kBrushed);
inputMotor = new CANSparkMax(inputMotorChannel, MotorType.kBrushless);
shooterMotor1 = new CANSparkMax(shooterMotorChannel, MotorType.kBrushless);
shooterMotor2 = new CANSparkMax(shooterMotorChannel2, MotorType.kBrushless);

}

/* HIGH LEVEL WHAT WE WANT TO DO:
*
* When the disc is slides in to the robot from the bottom, the intake motors are moving,
* then once the disc hits a metal sensor, the intake motors stop, and the disc is ready to be shot.
* Once the command is given to shoot the disc, the intake motors will spin inwards, and the shooter
* motors will spin clockwise
*/
@Override
public void periodic() {

if (/* controller button pressed */ true) {
inputMotor.set(1.0);
shooterMotor1.set(1.0);
shooterMotor2.set(1.0);
}
if (/*intakeSensor.get()*/ true) {
inputMotor.set(0);
shooterMotor1.set(0);
shooterMotor2.set(0);
}
}
}