Firmware control
DDC offers a high degree customization of LEDs, working alone or in harmony with your SimHub LED profile. All 24-bit colors, setting different brightness for each and every LED if you want to. Use the LED functions to control them.
There are 3 layers of firmware LED control (Startup, Bottom and Top) and 2 layers of SimHub LED control (Mask and SimHub). The SimHub layers will not be active until SimHub is open and you've made contact with the controller.
The LED system uses a fair bit of dynamic memory. In some cases too much for the 32U4-based boards to handle. You can save a lot of memory by setting #define ECOLED
to 1 in 2_Boards.ino.
The downside being that LEDBottom() is deactivated.
The 5 layers will apply one after the other, the next overwriting the former.
LEDStartup will send all its commands to your LEDs only once - on booting the controller. It will also send all commands only once after SimHub is closed.
LEDBottom update LEDs constantly, at roughly 60 Hz.
Mask join the party when SimHub is connected, and will by default turn off all LEDs, leaving a blank canvas for the SimHub layer. You can however punch holes in the mask for the layers below to shine through.
SimHub layer is built in the SimHub RGB editor and will along with the mask update at 60 Hz.
LEDTop update LEDs constantly, at roughly 60 Hz.
The purpose of LEDStartup over LEDBottom is that you'll be saving a lot of processing power if these LEDs don't need constant updating. A good example is a backlit button box with static colors.
Using the figure above, we'll go through the tabs where you set up firmware LED control:
15_LEDMask.ino
This is where you make holes in the mask. Simply list the LED numbers that will shine through the mask. As in the figure above, there are holes in the mask for LEDs 0, 3 and 7.
34_LEDStartup.ino
LED functions are used in tab 34-36 to manipulate the RGB LEDs. To follow the example at the top of the page we're turning LEDs 3-6 yellow (hex color FFFF00) and LED 7 light blue (hex color ADD8E6). Both are set to 40% relative brightness. Keep in mind that in LEDStartup, colorLED() is the only function that will work, since it is only run once and can't react to anything like triggerLED(), rotaryLED() and biteLED().
35_LEDBottom.ino
As in the figure at the top, we're lighting up LEDs 2-5 green (hex color 00FF00). In this case, we're making the LEDs blink, so we're using triggerLED() instead of colorLED().
36_LEDTop.ino
As in the figure at the top, we're making LEDs 1-2 purple (hex color FF00FF).
Last updated