Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Shane led #12

wants to merge 4 commits into from

Conversation

StabStabImAChicken
Copy link
Contributor

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


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);
Copy link
Contributor

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);
Copy link
Contributor

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

Copy link
Member

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

Copy link
Member

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);
Copy link
Contributor

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

Copy link
Contributor Author

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);
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 33 to 44
if(leftShoulder.getValue() == false){
cubeDisplay();
}else{
resetState();
}
}

if(leftShoulder.getValue()){
if(rightShoulder.getValue() == false){
coneDisplay();
}else{
resetState();
Copy link
Member

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()

@fruzyna fruzyna self-requested a review February 9, 2023 00:58
smccrorie and others added 2 commits February 20, 2023 21:02
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants