Added support for 7-Seg counter and improved Neopixel LED strip and effects #106
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.
Summary of New Features
Firmware Improvements
The firmware has been refactored to support a much deeper level of customization, especially regarding the NeoPixel LED strip.
Full support has been added for 7-Segment Counters, and NeoPixel LED strip functionality has been expanded:
7-Segment Counter:
Full functionality has been implemented for whmxe-595-2 counters based on the 74HC595 shift register, allowing life or ammo to be displayed.
Additionally, the two-character message shown on the 7-segment counter when the device is powered on is customizable. This message is configured from the GUI.
NeoPixel LED Strip Effects:
A complete system has been created, including life and ammo bars with gradient colors and a dynamic effects engine (Fire, Ice, Plasma, Beam, Knight Rider) with a 10-color palette, all configurable via serial command.
Multi-Sector LED Strip:
The most significant improvement is the ability to divide a single NeoPixel LED strip into up to four functional and independent sectors:
Fixed LED Sector: A number of LEDs at the beginning of the strip whose color is set from the GUI and is not affected by any other function. Ideal for indicating the player’s color.
Life Bar Sector: A group of LEDs functioning as a life bar, with a customizable color gradient.
Ammo Bar Sector: A group of LEDs functioning as an ammo bar, also with a customizable color gradient.
Effects Sector: A group of LEDs dedicated exclusively to displaying dynamic visual effects (Fire, Ice, etc.).
This feature is configured through new settings in the GUI, allowing you to define the start LED and the number of LEDs for each sector.
LED Effects Assignment to Buttons:
It is now also possible to assign any of the above-mentioned effects to some of the lightgun’s buttons (Trigger, Gun A, Gun B, Gun C, Pump Action, Pedal, Alt Pedal, Start, and Select) both On-Screen and Off-Screen, allowing a greater degree of customization for your OpenFIRE lightgun.
GUI Improvements (OpenFIRE-App)
To support the new firmware features, the desktop application has been updated as follows:
Board Layout tab:
Communication pins for the counter have been added for assignment in the board diagram.
NeoPixel Section in Gun Settings tab:
A new group has been added within the NeoPixel section for “LED Segment Configuration,” where you can define the start LED and the length of the life bar, ammo bar, and effects sector.
Real-time validation has been implemented to prevent saving configurations where segments overlap or exceed the total number of LEDs, including an error message showing the overlap issue.
A new group has been added for assigning effects to buttons.
7-Seg Counter Section in settings Tab:
Activation of the 7-segment counter and the initial counter type value has been added (modifiable via serial commands).
A new text field has been added to enter the custom startup message for the 7-segment counter.
Serial Port Communication (Mamehooker)
New Mode Commands (M):
New Effect Commands (FX):
All effects now follow a unified format:
<FX{Effect}x{Color}x{State}>
Effect Codes:
F = Fire
I = Ice
P = Plasma
B = Beam (Flash)
K = Knight Rider
Color Palette:
R = Red
G = Green
B = Blue
O = Orange
P = Purple
Y = Yellow
C = Cyan
M = Magenta
W = White
L = Lime
State:
1 = Activate
0 = Deactivate
Examples:
Activate Fire effect in Orange:
<FXFxOx1>
Activate Ice effect in Cyan:
<FXIxCx1>
Activate Knight Rider in Blue:
<FXKxBx1>
Deactivate any effect:
<FX...x0>
(e.g.,<FXFxOx0>
)Existing Life and Ammo Commands:
<FDLx{nn}>
- Value for life<FDAx{nn}>
- Value for ammoExamples:
<FDLx45>
- Sets life to 45 (on the LED bar it is converted into a percentage, with the first value received being considered 100%).<FDAx99>
- Sets ammo to 99 (on the LED bar it is converted into a percentage, with the first value received being considered 100%).