Skip to content

Commit

Permalink
LED animations: solid, rainbow, gradient, value mask
Browse files Browse the repository at this point in the history
  • Loading branch information
elwo-boop committed Mar 6, 2025
1 parent 552e140 commit 1769ead
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 276 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
}

def ROBOT_MAIN_CLASS = "frc.team449.Main"

Expand Down
14 changes: 2 additions & 12 deletions src/main/kotlin/frc/team449/RobotLoop.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import edu.wpi.first.wpilibj2.command.Command
import edu.wpi.first.wpilibj2.command.CommandScheduler
import edu.wpi.first.wpilibj2.command.InstantCommand
import frc.team449.auto.RoutineChooser
import frc.team449.commands.light.BlairChasing
import frc.team449.commands.light.BreatheHue
import frc.team449.commands.light.Rainbow
import frc.team449.subsystems.FieldConstants
import frc.team449.subsystems.drive.swerve.SwerveSim
import frc.team449.subsystems.superstructure.SuperstructureGoal
Expand Down Expand Up @@ -89,8 +86,6 @@ class RobotLoop : TimedRobot() {
SmartDashboard.putData("Routine Chooser", routineChooser)
SmartDashboard.putData("Command Scheduler", CommandScheduler.getInstance())

robot.light.defaultCommand = BlairChasing(robot.light)

controllerBinder.bindButtons()

DogLog.setOptions(
Expand All @@ -114,6 +109,8 @@ class RobotLoop : TimedRobot() {
if (RobotBase.isReal()) {
robot.wrist.startupZero()
}

robot.light.defaultCommand = robot.light.progressMask({ robot.elevator.positionSupplier.get() })
}

override fun driverStationConnected() {
Expand All @@ -134,12 +131,6 @@ class RobotLoop : TimedRobot() {
/** Every time auto starts, we update the chosen auto command. */
this.autoCommand = routineMap[if (DriverStation.getAlliance().getOrNull() == DriverStation.Alliance.Red) "Red" + routineChooser.selected else "Blue" + routineChooser.selected]
CommandScheduler.getInstance().schedule(this.autoCommand)

if (DriverStation.getAlliance().getOrNull() == DriverStation.Alliance.Red) {
BreatheHue(robot.light, 0).schedule()
} else {
BreatheHue(robot.light, 95).schedule()
}
}

override fun autonomousPeriodic() {}
Expand All @@ -163,7 +154,6 @@ class RobotLoop : TimedRobot() {
robot.drive.stop()

(robot.light.currentCommand ?: InstantCommand()).cancel()
Rainbow(robot.light).schedule()
}

override fun disabledPeriodic() {}
Expand Down
45 changes: 0 additions & 45 deletions src/main/kotlin/frc/team449/commands/light/BlairChasing.kt

This file was deleted.

46 changes: 0 additions & 46 deletions src/main/kotlin/frc/team449/commands/light/BreatheHue.kt

This file was deleted.

26 changes: 0 additions & 26 deletions src/main/kotlin/frc/team449/commands/light/Crazy.kt

This file was deleted.

30 changes: 0 additions & 30 deletions src/main/kotlin/frc/team449/commands/light/PickupBlink.kt

This file was deleted.

38 changes: 0 additions & 38 deletions src/main/kotlin/frc/team449/commands/light/Rainbow.kt

This file was deleted.

27 changes: 0 additions & 27 deletions src/main/kotlin/frc/team449/commands/light/SolidColor.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import kotlin.math.hypot
/**
* A Swerve Drive chassis.
* @param modules An array of [SwerveModule]s that are on the drivetrain.
* @param ahrs The gyro that is mounted on the chassis.
* @param maxLinearSpeed The maximum translation speed of the chassis.
* @param maxRotSpeed The maximum rotation speed of the chassis.
* @param field The SmartDashboard [Field2d] widget that shows the robot's pose.
Expand Down
Loading

0 comments on commit 1769ead

Please sign in to comment.