Skip to content

Commit

Permalink
minor changes to blinkin and rumble
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubleSnapps committed Jan 10, 2024
1 parent 9f0e308 commit 63e52c1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public void setDeadzone(double value) {
*
* @param value The normalized value for rumble intensity
*/
public void rumble(double value) {
m_hid.setRumble(GenericHID.RumbleType.kBothRumble, value);
public void rumble(double intensity) {
m_hid.setRumble(GenericHID.RumbleType.kBothRumble, intensity);
}

/**
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/frc/team5431/titan/core/leds/Blinkin.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package frc.team5431.titan.core.leds;

import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.DriverStation.Alliance;
import edu.wpi.first.wpilibj.motorcontrol.Spark;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
Expand Down Expand Up @@ -28,6 +30,21 @@ public void set(double value) {
spark.set(value);
}

/**
* Sets blinkin lights to current team color in Teleop
*/
public void setTeamColor() {
var robotTeam = DriverStation.getAlliance();
if (DriverStation.isTeleop()) {

This comment has been minimized.

Copy link
@democat3457

democat3457 Jan 10, 2024

Member

Why limit it to teleop?

if (robotTeam.get() == Alliance.Red) {
set(BlinkinPattern.RED);
}
if (robotTeam.get() == Alliance.Blue) {
set(BlinkinPattern.BLUE);
}
}
}

public void set(BlinkinPattern pattern) {
currentPattern = pattern;
spark.set(pattern.getSpark());
Expand Down

0 comments on commit 63e52c1

Please sign in to comment.