-
Notifications
You must be signed in to change notification settings - Fork 0
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
Shane led #12
base: main
Are you sure you want to change the base?
Shane led #12
Conversation
Created an LED controller. When right shoulder is pressed, the led displays purple. When the left shoulder is pressed, the led displays yellow. I do not know which port we are using, nor how long the LEDs are, so I commented out the while script.
- detecting whether right shoulder or left shoulder is pressed are both in an umbrella if statement - added sync timers - Changed return in getName() as Led Controller
|
||
public void coneDisplay(){ | ||
for (var i = 0; i < length; i++) { | ||
ledBuffer.setRGB(i, 250, 0, 250); |
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.
Yellow's RGB is 255,255,0
|
||
public void cubeDisplay(){ | ||
for (var i = 0; i < length; i++) { | ||
ledBuffer.setRGB(i, 215, 0, 250); |
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.
Violet's RGB is 255,0,255
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.
I'd argue his color is closer to purple though https://convertingcolors.com/rgb-color-215_0_250.html
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.
public void resetState() { | ||
led.stop(); | ||
for (var i = 0; i < length; i++) { | ||
ledBuffer.setRGB(i, 0, 0, 0); |
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.
If you want to work on this a bit more, make the "default" the rainbow example from the WPILib article, instead of just black
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.
A default of rainbow would be very distracting to the driver, and it could be confusing for the human players to understand when they should deploy a cone or cube
|
||
public void cubeDisplay(){ | ||
for (var i = 0; i < length; i++) { | ||
ledBuffer.setRGB(i, 215, 0, 250); |
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.
I'd argue his color is closer to purple though https://convertingcolors.com/rgb-color-215_0_250.html
|
||
public void cubeDisplay(){ | ||
for (var i = 0; i < length; i++) { | ||
ledBuffer.setRGB(i, 215, 0, 250); |
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.
src/main/java/org/wildstang/year2023/subsystems/led/LedController.java
Outdated
Show resolved
Hide resolved
if(leftShoulder.getValue() == false){ | ||
cubeDisplay(); | ||
}else{ | ||
resetState(); | ||
} | ||
} | ||
|
||
if(leftShoulder.getValue()){ | ||
if(rightShoulder.getValue() == false){ | ||
coneDisplay(); | ||
}else{ | ||
resetState(); |
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.
May want to reconsider this with the eventual rainbow mode which will need to continuously update via update()
- none of the programs have set time limits. The cone and cube lights will stay on until reset, in which Rainbow() will stay on until the robot is turned off
Subsystem: Led
Description:
The controller for the Addressable Leds. When right manipulator shoulder is pressed, the leds are purple, to signify cubes. When the left manipulator shoulder is pressed, the leds are yellow, to signify cones.
Tested: No
Collaborators: none