Skip to content

Improved three-channel interface and 3-channel strobes#114

Open
fwiffo wants to merge 11 commits intoToyKeeper:trunkfrom
fwiffo:improved_3ch
Open

Improved three-channel interface and 3-channel strobes#114
fwiffo wants to merge 11 commits intoToyKeeper:trunkfrom
fwiffo:improved_3ch

Conversation

@fwiffo
Copy link

@fwiffo fwiffo commented Oct 8, 2024

Implements the 3-channel features described in #113

The first 7 channels now follow the same sequence as AUX LEDs. I.e. if
the channels were red, green, and blue, the sequence would be red,
yellow, green, cyan, blue, magenta, and white. The remaining channels
are HSV, 3-channel auto-tint, and RGB AUX.

Removes the 2-channel tintramp modes since there is a limit of 16
channels and HSV mode covers those combinations with a more general
interface.

Next step will be adding explict control for saturation so that all
possible 3-channel combinations will be explicitly possible in HSV mode.
This allows for a "saturation" parameter in HSV modes on 3-channel
lights. This uses 4H, thus removing momentary turbo from channels that
require a second channel arg.

This is a silly way to implement it; it would be nice to be more generic
and allow for some struct or arbitrary number of channel args or
something, but how many lights need more than 2 channel args, and you'd
need to do something like 23H to manage it all.
If a light has a custom 3H function specified for a channel, it would
always call the custom function, not just during 3H events. It would
only return if the event was handled by the custom function, but would
fall out of the if/else otherwise, preventing later events from being handled.

This prevented access to the 9H channel config in HSV mode, for
instance.
Instead of bracketing the set_level() with saving/restoring the existing
channel_args, it instead puts them around save_config() calls.

This feels brittle, but an alternative - exposing a function that
bypasses set_level() to set HSV more directly - also feels brittle.
Brightness is still adjusted with 1H and 2H as with other modes, and
saturation is still available with 4H as it is in regular ramp mode on
the HSV channel.
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.

1 participant