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

LED Panel! #181

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

LED Panel! #181

wants to merge 8 commits into from

Conversation

SebZanardo
Copy link
Contributor

No description provided.

class LEDPanel:
# Key: Match number, Value: Drop Bears match number (<=15)
# TODO: Fill with proper values when the draw comes out
matches: dict[int, int] = {1: 1}
Copy link
Member

Choose a reason for hiding this comment

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

The match schedule has been published. Do you intend to fill this in now?

Comment on lines +92 to +95
self.send_packet()

def execute(self) -> None:
self.set_match_state()
Copy link
Member

Choose a reason for hiding this comment

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

This seems to send a packet multiple times each control loop iteration. Is this necessary?

self.panel_port = wpilib.SerialPort(
baudRate=9600, port=wpilib.SerialPort.Port.kUSB1, dataBits=8
)
self.set_match_id()
Copy link
Member

Choose a reason for hiding this comment

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

This happens on robot code start. getMatchNumber will always be invalid in this scenario, as the Driver Station will not have connected to the robot.

match_id = 0
if (
match_type == wpilib.DriverStation.MatchType.kQualification
or match_type == wpilib.DriverStation.MatchType.kElimination
Copy link
Member

Choose a reason for hiding this comment

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

Will both this robot code and the LED panel code be updated after every playoff match? Sounds tedious.

or match_type == wpilib.DriverStation.MatchType.kElimination
):
match_number = wpilib.DriverStation.getMatchNumber()
if match_number in self.matches:
Copy link
Member

Choose a reason for hiding this comment

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

This looks up the match number without using the match type. Is QF4 intended to be considered identical to Q4?

Comment on lines +31 to +32
elif wpilib.DriverStation.getMatchTime() <= 0:
# Post match
Copy link
Member

@auscompgeek auscompgeek Mar 15, 2024

Choose a reason for hiding this comment

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

Wouldn't this branch be hit before a match, and between auto and teleop, too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants