42 uint16_t currentIndex;
54 Channel(uint8_t p,
const char* pcb, CRGB* ledArray, uint16_t count) {
71 case 4: FastLED.addLeds<WS2812B, 4, GRB>(leds, ledCount);
break;
72 case 5: FastLED.addLeds<WS2812B, 5, GRB>(leds, ledCount);
break;
73 case 6: FastLED.addLeds<WS2812B, 6, GRB>(leds, ledCount);
break;
74 case 7: FastLED.addLeds<WS2812B, 7, GRB>(leds, ledCount);
break;
75 case 8: FastLED.addLeds<WS2812B, 8, GRB>(leds, ledCount);
break;
76 case 9: FastLED.addLeds<WS2812B, 9, GRB>(leds, ledCount);
break;
77 case 10: FastLED.addLeds<WS2812B, 10, GRB>(leds, ledCount);
break;
78 case 11: FastLED.addLeds<WS2812B, 11, GRB>(leds, ledCount);
break;
79 case 12: FastLED.addLeds<WS2812B, 12, GRB>(leds, ledCount);
break;
80 case 13: FastLED.addLeds<WS2812B, 13, GRB>(leds, ledCount);
break;
84 fill_solid(leds, ledCount, NVIS_BLACK);
92 template<
typename PanelType>
94 PanelType* panel = PanelType::getInstance(currentIndex, leds);
97 if (currentIndex + panel->getLedCount() > ledCount) {
100 digitalWrite(LED_BUILTIN, HIGH);
102 digitalWrite(LED_BUILTIN, LOW);
108 if (firstPanel ==
nullptr) {
112 Panel* currentPanel = firstPanel;
113 while (currentPanel->nextPanel !=
nullptr) {
114 currentPanel = currentPanel->nextPanel;
116 currentPanel->nextPanel = panel;
120 currentIndex += panel->getLedCount();
167 Panel* current = firstPanel;
168 while (current !=
nullptr) {
170 current = current->nextPanel;
181 Panel* current = firstPanel;
182 while (current !=
nullptr) {
184 current = current->nextPanel;
194 Panel* current = firstPanel;
195 while (current !=
nullptr) {
197 current = current->nextPanel;
207 fill_solid(leds, ledCount, NVIS_BLACK);
210 Panel* current = firstPanel;
211 while (current !=
nullptr) {
213 current = current->nextPanel;
uint8_t getPin() const
Gets the pin number for this channel.
void updateInstrLights(uint16_t brightness, const CRGB &color=NVIS_GREEN_A)
Updates backlights for all panels in this channel.
uint8_t getPanelCount() const
Gets the number of panels in this channel.
void initialize()
Initializes the LED strip with FastLED.
CRGB * getLeds() const
Gets the LED array for this channel.
Channel(uint8_t p, const char *pcb, CRGB *ledArray, uint16_t count)
Constructor for the Channel class.
void updateConsoleLights(uint16_t brightness, const CRGB &color=NVIS_GREEN_A)
Updates console lights for all panels in this channel.
void addPanel()
Adds a panel to the channel's linked list.
void updateFloodLights(uint16_t brightness)
Updates flood lights for all panels in this channel.
const char * getPcbName() const
Gets the PCB name for this channel.
void setAllLightsOff()
Turns off all lights in all panels of this channel and resets brightness state.
Panel * getFirstPanel() const
Gets the first panel in the channel's linked list.
uint16_t getLedCount() const
Gets the number of LEDs in this channel.
void setAllLightsOff()
Turns off all lights in this panel, irrespective of their role, and resets brightness state.
void setInstrLights(uint16_t newValue, const CRGB &color=NVIS_GREEN_A)
Set the color of all instrument backlight LEDs.
void setFloodlights(uint16_t newValue)
Sets the brightness of floodlight LEDs.
void setConsoleLights(uint16_t newValue, const CRGB &color=NVIS_GREEN_A)
Sets the color of all console backlight LEDs.