Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelLesirge committed Jan 30, 2024
2 parents 3393dab + be73a7a commit 63cc0a2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
package frc.robot;

import edu.wpi.first.math.util.Units;
import edu.wpi.first.wpilibj.RobotBase;
import edu.wpi.first.wpilibj.RobotController;

/**
* Use Constants as convenient storage to hold robot-wide numerical or boolean constants.
* All constants should be visible globally (public), not be on the instance (static), and should be not change (final).
* Do not put any functionality in this class.
*/
public final class Constants {
// Bot-specific constants.
public static final String SOME_VALUE; // This is a demo/test constant

/**
* This code determines what bot is being deployed and sets constants accordingly.
*
* Simulated bots cannot have a RoboRIO ID, so we must check if the bot is real. If it isn't, load production config.
* The production bot is always default, so if we do anything crazy to our bot during the tourney like swich the roborio the code works.
*
* @author Aceius E.
*/
static {
String serialNumber = RobotBase.isReal() ? RobotController.getSerialNumber() : "default";

switch (serialNumber) {
case "03282B00": // Wood Bot
SOME_VALUE = "Wood Bot Value";
break;

default: // Production Bot
SOME_VALUE = "Comp Bot Value";
break;
}
}

public static class DriverConstants {
public static final int DRIVER_JOYSTICK_PORT = 0;

Expand Down

1 comment on commit 63cc0a2

@AceiusRedshift
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How sigma

Please sign in to comment.