Author Topic: QMK and LEDs question  (Read 4747 times)

0 Members and 1 Guest are viewing this topic.

Offline SectorOMEGA

  • Thread Starter
  • Posts: 78
QMK and LEDs question
« on: Thu, 20 April 2017, 10:24:43 »
I have done my first 60% hand wired keyboard. Now I want a little expansion :) I saw that in the builder I can assign pins for backlight and caps lock. Tried the simple logic way LED(+)>430ohms resistor>teensy pin then LED(-)>ground. Nothing. I have tried even the backlight pin nothing. For backlight I just want 4 leds under it. Can anyone give advise what I'm doing wrong. Thank you in n advance

Offline Tactile

  • Posts: 1435
  • Location: Portland, OR
Re: QMK and LEDs question
« Reply #1 on: Thu, 20 April 2017, 13:09:35 »
I don't know if you're using a Teensy or a board with an onboard controller chip or what else but check your gear because a lot of the controllers are "active low" meaning you'd wire power to the LED and the controller pin would go low to make the ground connection and turn on the LED. IOW the controller pin, on at least some setups, provides ground, not power.
REΛLFORCE

Offline SectorOMEGA

  • Thread Starter
  • Posts: 78
Re: QMK and LEDs question
« Reply #2 on: Thu, 20 April 2017, 13:15:28 »
I'm using teensy 2++. So if get it right, the 5v teensy pin will go to the positive led pin and the negative pin of the led would go to the assigned pin? Am I right?

Offline Tactile

  • Posts: 1435
  • Location: Portland, OR
Re: QMK and LEDs question
« Reply #3 on: Thu, 20 April 2017, 13:21:56 »
I'm using teensy 2++. So if get it right, the 5v teensy pin will go to the positive led pin and the negative pin of the led would go to the assigned pin? Am I right?

Right. With a resistor somewhere in there, of course. The resistor can connect to either leg of the LED.

After that your source code might need modification so it knows about the "new" pins you're using. But get the wiring right first. You can look through the QMK "keyboards" directory to see how lights are handled in various boards.
« Last Edit: Thu, 20 April 2017, 13:44:09 by Tactile »
REΛLFORCE

Offline SectorOMEGA

  • Thread Starter
  • Posts: 78
Re: QMK and LEDs question
« Reply #4 on: Thu, 20 April 2017, 13:45:26 »
I'm using the builder from here: http://qmk.sized.io/ it allows options for selecting the pins needed from the teensy. I tried the above approach but nothing again :( went trough the pages of the QMK and saw code for the quantum part. Trying to figure out if the builder is adding to hex file once compiled.

Offline Tactile

  • Posts: 1435
  • Location: Portland, OR
Re: QMK and LEDs question
« Reply #5 on: Thu, 20 April 2017, 13:53:31 »
I'm using the builder from here: http://qmk.sized.io/ it allows options for selecting the pins needed from the teensy. I tried the above approach but nothing again :( went trough the pages of the QMK and saw code for the quantum part. Trying to figure out if the builder is adding to hex file once compiled.

I don't know anything about that firmware building tool. For your Teensy++ 2.0 make sure you're telling it that your controller is an AT90USB1286, and after that I have no idea. I've only built QMK from source. Someone else here may be able to chime in to help you further.
REΛLFORCE

Offline SectorOMEGA

  • Thread Starter
  • Posts: 78
Re: QMK and LEDs question
« Reply #6 on: Thu, 20 April 2017, 14:44:24 »
Thanks. Trying to figure out how this can work. But still more advises will be appreciated

Offline a-c

  • Posts: 196
  • Location: USA
Re: QMK and LEDs question
« Reply #7 on: Thu, 20 April 2017, 14:52:07 »
https://learn.sparkfun.com/tutorials/transistors/applications-i-switches

Build a low side circuit. Or compile QMK yourself and you can make it behave the way you wired it.

Offline Tactile

  • Posts: 1435
  • Location: Portland, OR
Re: QMK and LEDs question
« Reply #8 on: Thu, 20 April 2017, 15:00:28 »
a-c brings up a good point. That firmware building tool might be flipping the pins high to turn on the lights. IOW, my initial answer to you might be exactly wrong and backwards. Since I don't know anything about that tool I think I'll just exit stage left and hope I haven't done too much damage.

...seeya
REΛLFORCE

Offline SectorOMEGA

  • Thread Starter
  • Posts: 78
Re: QMK and LEDs question
« Reply #9 on: Fri, 21 April 2017, 01:39:55 »
No damge done at all. It opposite I have learned somethings for this hobby which I'm in from a month. Will keep digging to see how it works. Simce teensy is new to me, thats the reason I used the builder. But might be worth spending some hours for starting the build from scratch. Thank you both and still if some one has an idea how this is working it would be great to share :)

Offline SectorOMEGA

  • Thread Starter
  • Posts: 78
Re: QMK and LEDs question
« Reply #10 on: Tue, 02 May 2017, 01:10:12 »
Finally managed to do it. It was a wrongly assigned in the code. after a few corrections I have fully working CAPS LED :) Last night I have tried adding some underglow. I have soldered the wires, programmed the pins and tried with one 2x3x4mm LED and its working. The toggle button, the increase and decrease. So decided to wire 4 LEDS in series put 220ohm resistor hooked it up and nothing. I have power before the resistor and the leds but no glow. Checked the connections but they seem fine. Are 4 white LEDs too much for one pin?

Offline a-c

  • Posts: 196
  • Location: USA
Re: QMK and LEDs question
« Reply #11 on: Tue, 02 May 2017, 02:19:44 »
You need to connect the LEDs in parallel, not series.

Connecting them in series multiplies the voltage requirement.

A single pin can output 20mA. Calculate accordingly. The entire chip can handle a combined total of 200mA.

Offline SectorOMEGA

  • Thread Starter
  • Posts: 78
Re: QMK and LEDs question
« Reply #12 on: Tue, 02 May 2017, 02:38:38 »
Ok point taken :D Its obviously my bad Will try this tonight