Skip to content
Draft
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
1 change: 1 addition & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public static class RobotDimensions {
}

public static class Misc {
public static final int LED_Channel = -123; // because idk the channel yet
public static final double pi = 3.14159;
public static final double inchesToMeters = 0.0254; //multiple inches to get meters
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* the package after creating this project, you must also update the build.gradle file in the
* project.
*/
public class Robot extends TimedRobot {
public class Robot extends TimedRobot {

// Controller Reference
private final OperatorInterface mOperatorInterface = OperatorInterface.getInstance();
Expand Down
31 changes: 31 additions & 0 deletions src/main/java/frc/robot/util/LED.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package frc.robot.util;

import edu.wpi.first.wpilibj.PWM;
import frc.robot.Constants.Misc;

public class LED {
private static LED mInstance;
private static PWM mLED_ring = new PWM(Misc.LED_Channel);

private LED(){} // empty constructor

public static synchronized LED getInstance(){
if (mInstance == null){
mInstance = new LED();
}
return mInstance;
}

public double getPercentage(){
return mLED_ring.getRaw();
}

public void setPercentage(int amount){
if (amount > 255 || amount < 0){
System.out.println("Invalid amount for setPercentage:" + amount);

} else {
mLED_ring.setRaw(amount);
}
}
}