Page 1 of 1
Repurposing notification LEDs on Ergodox (TMK)
Posted: 13 Mar 2016, 20:29
by Plasmodium
So, I've built my Ergodox, and I'll be flashing my custom layout soon, probably using TMK as it seems the most flexible. But I have a few questions RE: notification LEDs.
1) What pins on the Teensy are they connected to? How might I find out?
2) Can I set an LED to be OFF when numlock is ON - I use the LEDs to tell me when something is 'wrong' - ie my standard behavior is to have numlock on and capslock off - if either is different, I'd like an LED to tell me.
3) Can I repurpose one of them as a layer LED? No-one needs a scroll lock LED! How would I go about that?
Posted: 17 Mar 2016, 11:30
by Plasmodium
Anyone? The TMK firmware I found doesn't seem to use LEDs by default at all, and the documentation is...sparse.
(
https://github.com/DavidMcEwan/tmk_keyb ... rd/ergodox )
Posted: 17 Mar 2016, 13:03
by flabbergast
1) You can test for connections with a multimeter (i.e. put it in 'measuring resistance mode'), put one lead to a LED leg (you'll probably need to try with both, and also with both ends of the resistor it's wired to), and then with the other multimeter lead try consecutively all the Teensy pins. On one of them, it should show resistance '0' (or something very close to that), and that means that the connection is there.)
2) This should be just a matter of editing 'led.c' and
switching the two branches of an 'if' statement.
3) This is possible but requires editing TMK sources (at the moment. There's going to be a way to do this soon-ish.) Meanwhile a solution
here and a follow-up
here.
Posted: 17 Mar 2016, 13:29
by Plasmodium
Thanks. I'll have a bash at this this evening. I'm wondering if there's some Ergodox documentation somewhere which tells me which pins are used for what - I'll do some digging.
Posted: 17 Mar 2016, 13:32
by flabbergast
I haven't had my hands on any of the Ergodoxes out there - I thought there are a couple of slightly different versions. If you can find a schematics for yours, then you can of course read off the connections from there
And sorry - I didn't notice you linked the firmware: apparently to swap the numlock light you only need to define INVERT_NUMLOCK macro:
https://github.com/DavidMcEwan/tmk_keyb ... /led.c#L29
Posted: 17 Mar 2016, 14:01
by Plasmodium
Interesting. How does one define that macro? Remove the '#'s? I'm not familiar with coding at all really (save a year of Java in high school), but I'm willing to muck around with it as long as the person I'm taking advice from sounds knowledgeable enough.
The only thing, though, is I don't have a any kind of caps lock LED at all ATM (ie, nothing happens if I turn caps on). Not sure how to tell if that's software or my bad soldering... [Edit] which you explained above, never mind...
Posted: 17 Mar 2016, 14:46
by Halvar
Plasmodium wrote: Interesting. How does one define that macro? Remove the '#'s?
No, # is not a comment sign in C, but it starts a special kind of commands (precompiler commands).
You best define INVERT_NUMLOCK in config.h.
Open config.h and add the line
somewhere in the middle, for example above
Code: Select all
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
Posted: 18 Mar 2016, 11:05
by Plasmodium
So, I did the INVERT_NUMLOCK change, as well as a few layout fixes (I had switched VOLU and VOLD the first time I did it, etc), but I still have no LEDs. Could it be that they are somehow disabled by default in the code somewhere?
I still accept it could be my bad soldering, but, if that is the case, I'm not going to bother with opening up the case, risking damage to the PCB again (I have a crappy soldering iron and no multimeter for testing the connections) etc for the time-being.
BTW, I've switched to this fork of the firmware, which is actually more up-to-date.
https://github.com/cub-uanic/tmk_keyboa ... rd/ergodox