GithubHelp home page GithubHelp logo

keyboardio / kaleidoscope-ledcontrol Goto Github PK

View Code? Open in Web Editor NEW
1.0 5.0 5.0 94 KB

LED Control plugin for Kaleidoscope.

License: GNU General Public License v3.0

C++ 89.67% C 8.04% Makefile 2.29%
arduino keyboard library kaleidoscope kaleidoscope-plugin

kaleidoscope-ledcontrol's Introduction

Kaleidoscope-LEDControl

This is a plugin for Kaleidoscope, for controlling the LEDs, and LED effects.

kaleidoscope-ledcontrol's People

Contributors

advisoray avatar algernon avatar gedankenexperimenter avatar iliana avatar mattvenn avatar obra avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kaleidoscope-ledcontrol's Issues

LED mode stacking

Based on keyboardio/Kaleidoscope-LEDEffect-SolidColor#2, #9, and LED mode interaction issues between ActiveModColor and others, I have a proposal: instead of having LED modes that have near-exclusive control over the LEDs, and a few special plugins like ActiveModColor that try to play well with them (but sometimes fail at that), how about making it possible to have more than one LED mode active at any given time? Similar in spirit to how layers work.

This way, ActiveModColor and NumLock would have it easier, as they'd just set the LEDs they want, and leave the rest to the modes that came before them. You could even have RainbowWave, Stalker, Wavepool, and ActiveModColor all active at the same time!

For this to work, we need to have an array that lists the modes we want (we already have this), a bitmap that describes which ones are active (we can use an uint16_t for this), and change a few methods to iterate over the active ones instead of calling the appropriate function for just one.

At a next step, we can optimize the LED modes further so that we iterate over the whole keymap only once instead of potentially as many times as we have active modes...

With this setup, we could rename LEDMode methods to:

  • setup(void) (or begin, depending on how we implement it): Called once when Kaleidoscope.use()-ing the plugin.
  • activate(void): Called whenever the mode is activated.
  • update(void) (or update(row, col)): The brains of it, called every cycle to update the LEDs.
  • deactivate(void): Called whenever the mode is deactivated.

Support for Underglow (along with per-key LEDs): LED grouping?

@Dygmalab's Raise will be using Kaleidoscope for its firmware, they have both per-key LEDs and some 30-odd LEDs around the frame for underglow. It would be incredibly awesome if we could easily support both. Being able to address the underglow LEDs is just one thing. We also need a way for LED effects to make use of them, since most are using the ROWS / COLS constants, and as such, are limited to per-key LEDs.

I have a couple of ideas which I'll explain below, but those are just that - ideas. The goal is to support both underglow and the existing per-key LEDs, in a convenient, and backwards-compatible manner.

Clean up methods in LEDMode class

Currently LEDMode has three separate methods called begin(), setup(), and init(), and it's not clear what the distinction is between them, or how new LED modes should choose which one (or more) of them to override.

Calling led_sync every cycle kills performance

As the title says, see keyboardio/Kaleidoscope#113 for the discussion. Short version is that adding the LEDOff effect to a sketch that has a main loop run at 2.2-2.4ms, pushes the duration towards 10ms, usually over it, too.

Perhaps it would be enough to call led_sync fewer times. If I'm not mistaken, calling it every ~16ms would still result in ~60 updates / second (which is plenty), and have a much smaller impact on average loop length.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.