# Creating a custom LED mode

**URL:** <https://community.keyboard.io/t/creating-a-custom-led-mode/2532>\
**Category:** Programming\
**Created:** [February 13, 2019, 12:58pm UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532 "2019-02-13T12:58:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kpgalligan](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/kpgalligan/32/2548_2.png) [@kpgalligan](https://community.keyboard.io/u/kpgalligan)\
**Post date:** [February 13, 2019, 12:58pm UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532/1 "2019-02-13T12:58:58Z")

</div>

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 😄, so not too much spare time.

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [February 13, 2019, 1:12pm UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532/2 "2019-02-13T13:12:48Z")

</div>

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](https://bitbucket.org/jamesnvc/keyboardiolayout/src/83b3df9fa5f82fdc9ada299d98e025148cf7bbd5/james_layout.ino#lines-381)

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [February 13, 2019, 2:21pm UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532/3 "2019-02-13T14:21:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![noseglasses](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/noseglasses/32/429_2.png) [@noseglasses](https://community.keyboard.io/u/noseglasses)\
**Post date:** [February 13, 2019, 10:41pm UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532/4 "2019-02-13T22:41:41Z")

</div>

And there is the [FunctionalColor plugin](https://community.keyboard.io/t/functionalcolor-v2-automatically-label-keys-with-colors/1362) that might save you some work. Not sure though if it works with current Kaleidoscope.

---

<div class="post-metadata">

**Author:** ![jdlien](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jdlien/32/372_2.png) [@jdlien](https://community.keyboard.io/u/jdlien)\
**Post date:** [February 13, 2019, 10:53pm UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532/5 "2019-02-13T22:53:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![atimholt](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/atimholt/32/1310_2.png) [@atimholt](https://community.keyboard.io/u/atimholt)\
**Post date:** [February 19, 2019, 9:12pm UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532/6 "2019-02-19T21:12:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jdlien](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jdlien/32/372_2.png) [@jdlien](https://community.keyboard.io/u/jdlien)\
**Post date:** [February 19, 2019, 9:37pm UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532/7 "2019-02-19T21:37:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![noseglasses](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/noseglasses/32/429_2.png) [@noseglasses](https://community.keyboard.io/u/noseglasses)\
**Post date:** [February 20, 2019, 9:23am UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532/8 "2019-02-20T09:23:07Z")

</div>

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](https://github.com/jdlien/Kaleidoscope-LEDEffect-FunctionalColor/pull/5).

---

<div class="post-metadata">

**Author:** ![jdlien](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jdlien/32/372_2.png) [@jdlien](https://community.keyboard.io/u/jdlien)\
**Post date:** [February 20, 2019, 9:35am UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532/9 "2019-02-20T09:35:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [February 20, 2019, 9:43am UTC](https://community.keyboard.io/t/creating-a-custom-led-mode/2532/10 "2019-02-20T09:43:29Z")

</div>

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.
