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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

public class MyFirstClass {
public static void main(String[] args) {
System.out.println("Hello, world");
System.out.println("Hello, world!!");
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package frc.robot.subsystems;

import com.ctre.phoenix6.hardware.TalonFX;

import edu.wpi.first.wpilibj2.command.SubsystemBase;

public class Intake extends SubsystemBase {


public final TalonFX intakeMotor = new TalonFX(deviceid:1);
public Intake() {
intakeMotor.set(speed: 0.75);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

public class RobotContainer {
private final Intake intake;
private final CommandXboxController controller = new CommandXboxController(port:1);
public RobotContainer() {
intake = new Intake();
intake = newIntake();
controller.x().whileTrue(Commands.startEnd(intake::intake, intake::stop, intake));
}
public Intake getIntake() {
return intake;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

public class Intake extends SubsystemBase {

private final TalonFX intakeMotor = new TalonFX(1);

public Intake(){}
public void intake(){
intakeMotor.set(1);
}
public void eject(){
intakeMotor.set(-1);
}
public void stop() {
intakeMotor.set(0);
}

}