Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
control queuer motor
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaylagirard committed Aug 3, 2024
1 parent e31d8a4 commit 1cdb956
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
25 changes: 24 additions & 1 deletion src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class Robot extends TimedRobot {
public Robot() {
DogLog.setOptions(new DogLogOptions().withLogEntryQueueCapacity(1500).withNtPublish(true));
DogLog.setOptions(new DogLogOptions().withNtPublish(true));

// Record metadata
DogLog.log("Metadata/ProjectName", BuildConstants.MAVEN_NAME);
Expand Down Expand Up @@ -66,6 +66,29 @@ public void robotInit() {}
@Override
public void robotPeriodic() {
CommandScheduler.getInstance().run();


// left trigger: intake
// right trigger: shoot

DogLog.log("Test/RobotPeriodic", true);

queuer.setIntakeMode(controller.getLeftTriggerAxis() >= 0.5);
queuer.setShootingMode(controller.getRightTriggerAxis() >= 0.5);

// if (controller.getLeftTriggerAxis() >= 0.5) {
// queuer.setIntakeMode(true);
// } else if (controller.getLeftTriggerAxis() < 0.5) {
// queuer.setIntakeMode(false);
// }

// if (controller.getRightTriggerAxis() >= 0.5) {
// queuer.setShootingMode(true);
// } else if (controller.getRightTriggerAxis() < 0.5) {
// queuer.setShootingMode(false);
// }

}


@Override
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/frc/robot/queuer/QueuerSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.revrobotics.CANSparkMax;

import dev.doglog.DogLog;
import frc.robot.util.scheduling.LifecycleSubsystem;
import frc.robot.util.scheduling.SubsystemPriority;

Expand All @@ -22,6 +23,9 @@ public QueuerSubsystem(CANSparkMax motor) {

@Override
public void robotPeriodic() {
DogLog.log("Queuer/IntakeMode", intaking);
DogLog.log("Queuer/ShootingMode", shooting);

if (intaking) {
motor.set(0.3);
} else if (shooting) {
Expand All @@ -33,10 +37,10 @@ public void robotPeriodic() {
//if shooting set motor voltage to -0.5
//if neither set voltage to 0
}
public boolean setIntakeMode() {
return intaking = true;
public void setIntakeMode(boolean enabled) {
intaking = enabled;
}
public boolean setShootingMode() {
return shooting = true;
public void setShootingMode(boolean on) {
shooting = on;
}
}

0 comments on commit 1cdb956

Please sign in to comment.