-
Notifications
You must be signed in to change notification settings - Fork 0
Added LED stuff #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TH3D0LPH1N
wants to merge
22
commits into
main
Choose a base branch
from
LED-code
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Added LED stuff #67
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2dd0ab1
Added LED stuff
TH3D0LPH1N d1b742b
control lights via LEDStatus command
marisa07 5a37e7f
wip fix wilson's code
newton-wong c24ef79
Merge branch 'LED-code' of https://github.com/Team5924/GoldenGateRobo…
newton-wong 336843d
Everything to do with color choice has been fixed
TH3D0LPH1N fec6d08
Found a mistake, and fixed it
TH3D0LPH1N 68bc16b
builds, needs testing
marisa07 4aafaff
fix merge conflicts
newton-wong 3e9ee07
fix build issues and merge conflicts
newton-wong 69a43bc
Pulled main into this jawn
bluesupergiant 6f7fad9
set tuning_mode to false
TH3D0LPH1N 0358bfa
fix autos
newton-wong 15feb89
Merge branch 'ebr-hotfix' of https://github.com/Team5924/GoldenGateRo…
newton-wong 4f353a0
fix autos for the second time
newton-wong 94cda86
fix pose flipping
newton-wong eaa28ff
push autos for match
newton-wong e51c7ed
Merge branch 'LED-code' of https://github.com/Team5924/GoldenGateRobo…
newton-wong 24a99ea
merge new auto align branch into this one
newton-wong 0711cd7
LED untested
newton-wong eaa0e05
fix merge conflicts
newton-wong cf6643b
bellarmine kid assist
newton-wong 582d5c9
nothing works
newton-wong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/java/org/team5924/frc2025/commands/lights/LEDStatus.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /* | ||
| * LEDStatus.java | ||
| */ | ||
|
|
||
| /* | ||
| * Copyright (C) 2024-2025 Team 5924 - Golden Gate Robotics and/or its affiliates. | ||
| * | ||
| * This file, and the associated project, are offered under the GNU General | ||
| * Public License v3.0. A copy of this license can be found in LICENSE.md | ||
| * at the root of this project. | ||
| * | ||
| * If this file has been separated from the original project, you should have | ||
| * received a copy of the GNU General Public License along with it. | ||
| * If you did not, see <https://www.gnu.org/licenses>. | ||
| */ | ||
|
|
||
| package org.team5924.frc2025.commands.lights; | ||
|
|
||
| import edu.wpi.first.wpilibj2.command.Command; | ||
| import org.team5924.frc2025.RobotState; | ||
| import org.team5924.frc2025.subsystems.lights.Lights; | ||
|
|
||
| public class LEDStatus extends Command { | ||
| /** Creates a new LEDstatus. */ | ||
| private Lights leds; | ||
|
|
||
| double limeErrorTolerance = 1.5; // in degrees | ||
|
|
||
| public LEDStatus(Lights leds) { | ||
| this.leds = leds; | ||
| // addRequirements(leds); | ||
| } | ||
|
|
||
| // Called when the command is initially scheduled. | ||
| @Override | ||
| public void initialize() {} | ||
|
|
||
| // Called every time the scheduler runs while the command is scheduled. | ||
| @Override | ||
| public void execute() { | ||
| switch (RobotState.getInstance().getElevatorState()) { | ||
| case L3 -> Lights.LEDSegment.MainStrip.setColor(Lights.blue); | ||
| default -> Lights.LEDSegment.MainStrip.disableLEDs(); | ||
| } | ||
| } | ||
|
|
||
| // Called once the command ends or is interrupted. | ||
| @Override | ||
| public void end(boolean interrupted) {} | ||
|
|
||
| // Returns true when the command should end. | ||
| @Override | ||
| public boolean isFinished() { | ||
| return false; | ||
| } | ||
| } | ||
43 changes: 43 additions & 0 deletions
43
src/main/java/org/team5924/frc2025/commands/lights/SetLEDColorCommand.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * SetLEDColorCommand.java | ||
| */ | ||
|
|
||
| /* | ||
| * Copyright (C) 2024-2025 Team 5924 - Golden Gate Robotics and/or its affiliates. | ||
| * | ||
| * This file, and the associated project, are offered under the GNU General | ||
| * Public License v3.0. A copy of this license can be found in LICENSE.md | ||
| * at the root of this project. | ||
| * | ||
| * If this file has been separated from the original project, you should have | ||
| * received a copy of the GNU General Public License along with it. | ||
| * If you did not, see <https://www.gnu.org/licenses>. | ||
| */ | ||
|
|
||
| package org.team5924.frc2025.commands.lights; | ||
|
|
||
| import edu.wpi.first.wpilibj2.command.Command; | ||
| import org.team5924.frc2025.subsystems.lights.LEDSubsystem; | ||
|
|
||
| public class SetLEDColorCommand extends Command { | ||
| private final LEDSubsystem led; | ||
| private final int r, g, b; | ||
|
|
||
| public SetLEDColorCommand(LEDSubsystem led, int r, int g, int b) { | ||
| this.led = led; | ||
| this.r = r; | ||
| this.g = g; | ||
| this.b = b; | ||
| addRequirements(led); | ||
| } | ||
|
|
||
| @Override | ||
| public void initialize() { | ||
| led.setColor(r, g, b); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isFinished() { | ||
| return true; // run once and done | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
37
src/main/java/org/team5924/frc2025/subsystems/Lights/LEDSubsystem.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| * LEDSubsystem.java | ||
| */ | ||
|
|
||
| /* | ||
| * Copyright (C) 2024-2025 Team 5924 - Golden Gate Robotics and/or its affiliates. | ||
| * | ||
| * This file, and the associated project, are offered under the GNU General | ||
| * Public License v3.0. A copy of this license can be found in LICENSE.md | ||
| * at the root of this project. | ||
| * | ||
| * If this file has been separated from the original project, you should have | ||
| * received a copy of the GNU General Public License along with it. | ||
| * If you did not, see <https://www.gnu.org/licenses>. | ||
| */ | ||
|
|
||
| package org.team5924.frc2025.subsystems.lights; | ||
|
|
||
| import com.ctre.phoenix.led.CANdle; | ||
| import com.ctre.phoenix.led.CANdleConfiguration; | ||
|
|
||
| import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
|
|
||
| public class LEDSubsystem extends SubsystemBase { | ||
| private final CANdle candle; | ||
|
|
||
| public LEDSubsystem(int canId) { | ||
| candle = new CANdle(canId); | ||
|
|
||
| CANdleConfiguration config = new CANdleConfiguration(); | ||
|
|
||
| } | ||
|
|
||
| public void setColor(int r, int g, int b) { | ||
| candle.setLEDs(r, g, b); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of the default command and move this into the periodic call of LED subsytem