1414import org .steelhawks .generated .TunerConstants ;
1515import org .steelhawks .generated .TunerConstantsAlpha ;
1616import org .steelhawks .generated .TunerConstantsHawkRider ;
17- import org .steelhawks .subsystems .LED .LEDColor ;
17+ import org .steelhawks .subsystems .led . LED .LEDColor ;
1818import edu .wpi .first .wpilibj2 .command .Commands ;
1919import edu .wpi .first .wpilibj2 .command .button .CommandXboxController ;
2020import org .steelhawks .Constants .*;
21- import org .steelhawks .subsystems .LED ;
21+ import org .steelhawks .subsystems .led . LEDMatrix ;
2222import org .steelhawks .subsystems .algaeclaw .*;
2323import org .steelhawks .subsystems .align .Align ;
2424import org .steelhawks .subsystems .align .AlignIO ;
4040
4141public class RobotContainer {
4242
43- private final LED s_LED = LED .getInstance ();
43+ // private final LED s_LED = LED.getInstance();
44+ private final LEDMatrix s_LEDMatrix = new LEDMatrix (32 , 8 );
4445 public static Swerve s_Swerve = null ;
4546 public static Vision s_Vision = null ;
4647 public static Elevator s_Elevator = null ;
@@ -255,8 +256,29 @@ public RobotContainer() {
255256 configureTriggers ();
256257 configureDriver ();
257258
258- s_LED .setDefaultCommand (new LEDDefaultCommand (() -> manualToggled ));
259+ // s_LED.setDefaultCommand(new LEDDefaultCommand(() -> manualToggled));
259260 s_AlgaeClaw .setDefaultCommand (new AlgaeClawDefaultCommand ());
261+
262+ // s_LEDMatrix.rainbowWaveCommand(3).schedule();
263+ s_LEDMatrix .fireCommand (50 , 120 ).schedule ();
264+ // s_LEDMatrix.bouncingBallCommand(LEDMatrix.Color.GREEN, 3).schedule();
265+ // s_LEDMatrix.scrollingTextCommand("STEEL HAWKS", LEDMatrix.Color.RED, 2).schedule();
266+ // s_LEDMatrix.plasmaCommand(3).schedule();
267+
268+ // line left to right test
269+ // for (int x = 0; x < 16; x++) {
270+ // s_LEDMatrix.setPixel(x, 0, LEDMatrix.Color.RED);
271+ // }
272+ // s_LEDMatrix.show();
273+ //
274+ // for (int y = 0; y < 16; y++) {
275+ // s_LEDMatrix.setPixel(0, y, LEDMatrix.Color.GREEN);
276+ // }
277+ // s_LEDMatrix.show();
278+
279+ // small square test
280+ // s_LEDMatrix.fillRect(6, 6, 4, 4, LEDMatrix.Color.RED);
281+ // s_LEDMatrix.show();
260282 }
261283
262284 private void setManualToggled (boolean value ) {
@@ -284,20 +306,20 @@ private void checkIfDevicesConnected() {
284306 private void configureTriggers () {
285307 s_Elevator .atLimit ()
286308 .onTrue (
287- s_LED .flashCommand (LEDColor .PURPLE , 0.1 , 1 ).ignoringDisable (false ));
309+ s_LEDMatrix .flashCommand (LEDColor .PURPLE , 0.1 , 1 ).ignoringDisable (false ));
288310
289311 new Trigger (() -> s_Claw .hasCoral ())
290312 .onTrue (
291313 Commands .parallel (
292- s_LED .flashCommand (LEDColor .GREEN , 0.1 , 0.5 ),
314+ s_LEDMatrix .flashCommand (LEDColor .GREEN , 0.1 , 0.5 ),
293315 new VibrateController (1.0 , 1.0 , driver ))
294316 .ignoringDisable (false ));
295317
296318 if (s_AlgaeClaw != null ) {
297319 new Trigger (() -> s_AlgaeClaw .hasAlgae ())
298320 .onTrue (
299321 Commands .parallel (
300- s_LED .flashCommand (LEDColor .GREEN , 0.1 , 1.0 ),
322+ s_LEDMatrix .flashCommand (LEDColor .GREEN , 0.1 , 1.0 ),
301323 new VibrateController (1.0 , 1.0 , driver ))
302324 .ignoringDisable (false ));
303325 }
@@ -319,7 +341,7 @@ private void configureDriver() {
319341 if (!s_Elevator .isLocked ()) {
320342 Commands .parallel (
321343 new VibrateController (1.0 , 1.0 , driver ),
322- s_LED .flashCommand (LEDColor .RED , 0.1 , 1.0 )).schedule ();
344+ s_LEDMatrix .flashCommand (LEDColor .RED , 0.1 , 1.0 )).schedule ();
323345 return ;
324346 }
325347
@@ -382,8 +404,8 @@ private void configureDriver() {
382404 .alongWith (
383405 new VibrateController (driver ),
384406 Commands .either (
385- s_LED .flashCommand (LEDColor .GREEN , 0.2 , 2 ),
386- s_LED .flashCommand (LEDColor .RED , 0.2 , 2 ),
407+ s_LEDMatrix .flashCommand (LEDColor .GREEN , 0.2 , 2 ),
408+ s_LEDMatrix .flashCommand (LEDColor .RED , 0.2 , 2 ),
387409 () -> s_Swerve .isSlowMode ()).withInterruptBehavior (InterruptionBehavior .kCancelSelf )));
388410
389411 driver .rightStick ()
@@ -418,12 +440,12 @@ private void configureDriver() {
418440 driver .leftTrigger ()
419441 .whileTrue (
420442 s_Claw .shootCoral ()
421- .alongWith (LED . getInstance () .flashCommand (LEDColor .WHITE , 0.2 , 2.0 ).repeatedly ()));
443+ .alongWith (s_LEDMatrix .flashCommand (LEDColor .WHITE , 0.2 , 2.0 ).repeatedly ()));
422444
423445 driver .povLeft ()
424446 .whileTrue (
425447 s_Claw .reverseCoral ()
426- .alongWith (LED . getInstance () .flashCommand (LEDColor .PINK , 0.2 , 2.0 ).repeatedly ()));
448+ .alongWith (s_LEDMatrix .flashCommand (LEDColor .PINK , 0.2 , 2.0 ).repeatedly ()));
427449
428450 driver .povDown ()
429451 .whileTrue (
@@ -482,7 +504,7 @@ private void configureDriver() {
482504 ReefState .removeScoredCoral (lastPosition );
483505 Commands .parallel (
484506 new VibrateController (1.0 , 0.25 , driver ),
485- s_LED .flashCommand (LEDColor .GREEN , 0.2 , 2.0 )).schedule ();
507+ s_LEDMatrix .flashCommand (LEDColor .GREEN , 0.2 , 2.0 )).schedule ();
486508 }
487509 }))
488510 .onFalse (
@@ -491,9 +513,9 @@ private void configureDriver() {
491513 Toggles .autoMark .set (!Toggles .autoMark .get ());
492514 autoMarkingDisabled .set (!Toggles .autoMark .get ());
493515 if (Toggles .autoMark .get ()) {
494- s_LED .flashCommand (LEDColor .GREEN , 0.2 , 2.0 ).schedule ();
516+ s_LEDMatrix .flashCommand (LEDColor .GREEN , 0.2 , 2.0 ).schedule ();
495517 } else {
496- s_LED .flashCommand (LEDColor .RED , 0.2 , 2.0 ).schedule ();
518+ s_LEDMatrix .flashCommand (LEDColor .RED , 0.2 , 2.0 ).schedule ();
497519 }
498520 }
499521 toggleTriggered = false ;
@@ -510,7 +532,7 @@ private void configureDriver() {
510532 .getDistance (s_Swerve .getPose ().getTranslation ()) <= 1.5
511533 ) {
512534 ReefState .scoreCoral (ReefUtil .getClosestCoralBranch (), s_Elevator .getState ());
513- s_LED .flashCommand (LEDColor .BLUE , 0.2 , 2.0 ).schedule ();
535+ s_LEDMatrix .flashCommand (LEDColor .BLUE , 0.2 , 2.0 ).schedule ();
514536 }
515537 }));
516538 }
0 commit comments