Creating a custom LED mode


(Kevin Galligan) #1

What I’d like to do is create an LED mode that just lights up the non-letter keys. I type in Colemak, but that’s still relatively new. On my other keyboards I have moved the keys, but until there are alternate keysets, that’s not an option. I’m still learing where keys are on the keyboardio. It’s not a huge deal, but I’d like to be able to light everything except the letter keys. I find the letters visually in the wrong place to be slightly disorienting (although a couple months into Colemak that’s far less of a problem than it was at a couple weeks).

With full understanding of the firmware I’m sure this would be trivial. Before I spend a ton of time hacking, I’m hoping there’s something obvious, like the equivalent of a keymap for the LEDs in some special mode.

I have the “Model01-Firmware” and Arduino pipeline working, and have been doing basic layout hacking. Moving beyond that is the tentative next step, although I have other “day job” hacking to do as well :smile:, so not too much spare time.


How do i get my LED effects back after updating firmware w/Chrysalis?
(James Cash) #2

Making an LED mode is pretty straightforward; you make a class that subclasses LEDMode, then in the update method, you can set the colour for each LED in 0…LED_COUNT. I believe the LED indices start at zero in the bottom-left, then go up and wrap down (using ::LEDControl.setCrgbAt(row, col, colour) might be better than the method I used below). For example, see:

https://bitbucket.org/jamesnvc/keyboardiolayout/src/83b3df9fa5f82fdc9ada299d98e025148cf7bbd5/james_layout.ino#lines-381


(Gergely Nagy) #3

Another option is to use the Colormap plugin, and set up the colors with Chrysalis for each layer. No programming required! It’s a bit boring to set this up though, so if you’re in for a slightly bigger challenge and are interested in poking at the firmware anyway, writing a custom LED mode is the way to go indeed.


(Noseglasses) #4

And there is the FunctionalColor plugin that might save you some work. Not sure though if it works with current Kaleidoscope.


(JD Lien) #5

Yeah, I’ve had reports that it doesn’t work. I still haven’t looked into it any time recently… I suppose I should do that.


(Tim Holt) #6

Not to bug you, but functional color is one of the Model 01’s “killer apps” to me (I use a lot of layers). I was about to get back into tweaking my firmware again, but I’ll have to hold off for now.

I’ll poke around the code myself, I guess, but I doubt I’ll figure anything out.


(JD Lien) #7

I’m glad you find it useful. I did put a fair amount of work into making FunctionalColor so I do feel bad that it’s not so useful for people at the moment.


(Noseglasses) #8

I just got around working with the M01 after a very long time. As a little exercise to get used again to firmware programming I fixed the FunctionalColor plugin. @jdlien, heres the PR.


(JD Lien) #9

Wow, thanks so much! I will have a look this evening and see if I can get it running and test it out.

Should I make this a new project on Github or will this be reverse compatible with older firmwares as well?


(Gergely Nagy) #10

It’s not compatible with older versions of Kaleidoscope. For official plugins, we created a “v1” branch for the older code, and master requires a newer Kaleidoscope.