LED rework#8
Draft
cameronm57 wants to merge 28 commits into
Draft
Conversation
tested, works
…nstead of two methods for each variable
… is uncalibrated. added comments throughout updated code.
…f color -> bcrcolor !! not done doesnt work !!
…ctive events, new method created to allow this
uses maps instead of arrays, method added to get priority of event instead of using a loop to iterate through an array, logic added to allow for a full circle of updates (idle -> piece -> shoot -> idle, etc.), names of events in enum and all references changed from camelCase to capitalized with underscores, removed rainbow and shooterRPM in BCRColor enum. To-Do: implement last 10 second timer, update LEDs whenever robot state changes (will likely fix problem regarding intaking not being displayed)
removed the "non-permanent piece detection when robot is disabled" due to earlier removal of piece timer
|
Converted to a draft since this will not be merged (did not implement handling RobotState changes since this is a proof of concept). Let's keep the PR open so it is easy to see the changes. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changed to an Event system. Pass in the LED subsystem and call LED.sendEvent(event) with the event that occurred. LED displays are not being managed in the LED.periodic(). There are two enum types of events -- StripEvents and CANdleEvents -- which are matched to priority levels. We compare the priority levels of the previous event and the new event, and continue with the event if the new event's priority is greater than or equal to the previous event.
Special Cases:
Managing States: