While the original plugin was written independently, significant developments
were made while working for Keyboard.io. As such, I feel it is appropriate to
assign copyright to the company.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
When using the V1 compatibility layer, in the `onSetup()` method, we need to
call `LEDControl.mode_add()`, otherwise the mode does not register, and will not
function.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
The default `onSetup` will call `.begin`, to support initializing plugins using
the V1 plugins while using `KALEIDOSCOPE_INIT_PLUGINS`. However, plugins that
implement a compatibility layer so that they can be used with both the new API,
and with `Kaleidoscope.use()` will have a `.begin` method too. Which the default
`onSetup` will call, and we'll register the compatibility layer too, in addition
to the new-style event handlers. This results in many things running twice,
which leads to all kinds of problems.
For this reason, override `onSetup`, so that it does not call `begin`. When used
with `Kaleidoscope.use()`, the plugin will still work, so compatibility is
maintained. But the bug is now gone.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Use a timeout calculation method that is not affected by overflow, and also
requires 16 bits less.
This likely fixes#8.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
There already exist 2 rainbow LED effects, this adds a third, using
the LED-Stalker effect.
When you press a key, the LED on that key will cycle through all the
colors of the rainbow, independent of the colors of other keys.
While technically one can specify colors otherwise, for the sake of simplicity,
mention only `CRGB`, but do mention it explicitly, so the reader does not need
to look at the example to figure this out.
Fixes#9.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Since we keep the eventHandler on at all times, even when we are not active,
clear the map when switching to the layer. It's easier this way than trying to
turn the eventHandler off.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Instead of calculating the time delta each time we check for a timeout,
pre-calculate the projected ending time, and compare against that.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
With the recent speedup of the scan cycle, we need some delays for the animation
to look nice.
Fixes#2.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Only turn the LED off if it was on before. Otherwise we will turn off those too
that were not in the map yet.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>