Skip to content

Commit

Permalink
Merge branch 'ez-servo'
Browse files Browse the repository at this point in the history
  • Loading branch information
billknopfjr committed Mar 1, 2025
2 parents 8ba6241 + b75f883 commit 6f496ae
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/team/gif/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//import team.gif.robot.commands.drivetrainPbot.DrivePracticeSwerve;
import team.gif.robot.subsystems.Climber;
import team.gif.robot.subsystems.Diagnostics;
import team.gif.robot.subsystems.Flapper;
import team.gif.robot.subsystems.Elevator;
import team.gif.robot.subsystems.Shooter;
import team.gif.robot.subsystems.SwerveDrivetrainMk4;
Expand Down Expand Up @@ -53,6 +54,7 @@ public class Robot extends TimedRobot {
public static Shooter shooter;
public static Climber climber;
public static Elevator elevator;
public static Flapper flapper;

// custom fields
private boolean autoSchedulerOnHold;
Expand Down Expand Up @@ -84,7 +86,7 @@ public Robot() {
oi = new OI();
uiSmartDashboard = new UiSmartDashboard();
pigeon.addToShuffleboard("Heading");

flapper = new Flapper(RobotMap.SERVO_PORT_ID);
shooter.setDefaultCommand(new StageCoral());

// Add a second periodic function to remove non-essential updates from the main scheduler
Expand Down Expand Up @@ -143,6 +145,9 @@ public void autonomousInit() {
autoSchedulerOnHold = true;
}

//drops servo at start of match
flapper.setDown();

}

/** This function is called periodically during autonomous. */
Expand Down Expand Up @@ -172,6 +177,8 @@ public void teleopInit() {
//-compressor.enableDigital();
compressor.disable();
climber.setPistonIn();

flapper.setDown();
}

/** This function is called periodically during operator control. */
Expand Down
1 change: 1 addition & 0 deletions src/main/java/team/gif/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public abstract class RobotMap {
//Shooter
public static final int SHOOTER_MOTOR_ID = 41;
public static final int INDEXER_MOTOR_ID = 42;
public static final int SERVO_PORT_ID = 0;

public static final int INDEXER_GP_SENSOR_PORT = 0;
public static final int EXIT_GP_SENSOR_PORT = 1;
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/team/gif/robot/subsystems/Flapper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 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 team.gif.robot.subsystems;

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

public class Flapper extends SubsystemBase {
private static Servo servo;

public Flapper(int port) {
servo = new Servo(port);
}

public void setDown() {
servo.set(1.0);
}
}

0 comments on commit 6f496ae

Please sign in to comment.