Hello,
Long time lurker to the forum and im about to build my first keyboard and the one thing I cant find is how to properly connect the three lock key, caps scroll and num, leds to the teensy 2.0 so i can program the avr controller to turn the light on and off when the corresponding keys are activated and turn off when they are deactivated.
Wiring Up Lock Key LEDS to a Teensey
- Redmaus
- Gotta start somewhere
- Location: Near Dallas, Texas
- Main keyboard: Unsaver | 3276 | Kingsaver
- Main mouse: Kensington Slimblade
- Favorite switch: Capacitative Buckling Spring
- DT Pro Member: -
- Contact:
Bump
-
- Main keyboard: Razer Blackwidow Tournament (blue switches)
- Main mouse: Razer Abysuss 2013 with modified LED
- Favorite switch: Cherry MX Blues
- DT Pro Member: -
Sorry did I post in the wrong thread? If I did I will delete this and repost in the appropriate one. Sorry im new hereRedmaus wrote: ↑Bump
- kbdfr
- The Tiproman
- Location: Berlin, Germany
- Main keyboard: Tipro MID-QM-128A + two Tipro matrix modules
- Main mouse: Contour Rollermouse Pro
- Favorite switch: Cherry black
- DT Pro Member: 0010
Bumping a thread 12 minutes after it was created? Not sure I really get the sense of itRedmaus wrote: ↑Bump
No, you're perfectly right. Good luck with your question (which I unfortunately cannot answer)Davsmith4 wrote: ↑[…] Sorry did I post in the wrong thread? If I did I will delete this and repost in the appropriate one. Sorry im new here
and welcome to DT
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
The easiest way is wiring like this: <pin on teensy> --- LED anode (+) - LED cathode (-) --- resistor --- ground.
The pin on teensy should no be used for anything else (so you'll need a free teensy pin for each LED). Resistor needs to limit the current through LED to that it doesn't take more than 10mA, and altogether all LEDs should take at most cca 50mA (there's a low limit because this way the LEDs take the current from the teensy, through the microcontroller).
This way, the LED lights up when the pin is taken high, and is off when the pin is low. Of course you can put the resistor between the pin and the LED instead; or you can reverse the LED and end in VCC (5V). (That way you can actually let a bit more current through, cca 15mA). For the resistor/current calculations, you can use this.
There are other ways which can be used if you want to power the LEDs directly from the USB current, or if you need to control more LEDs than free teensy pins. But wiring this way is the easiest if you need only a few LEDs.
From the point of the view of the firmware, all it needs to know is to which pin the LED is wired. This is certainly configurable in TMK; I haven't tried other firmwares yet.
The pin on teensy should no be used for anything else (so you'll need a free teensy pin for each LED). Resistor needs to limit the current through LED to that it doesn't take more than 10mA, and altogether all LEDs should take at most cca 50mA (there's a low limit because this way the LEDs take the current from the teensy, through the microcontroller).
This way, the LED lights up when the pin is taken high, and is off when the pin is low. Of course you can put the resistor between the pin and the LED instead; or you can reverse the LED and end in VCC (5V). (That way you can actually let a bit more current through, cca 15mA). For the resistor/current calculations, you can use this.
There are other ways which can be used if you want to power the LEDs directly from the USB current, or if you need to control more LEDs than free teensy pins. But wiring this way is the easiest if you need only a few LEDs.
From the point of the view of the firmware, all it needs to know is to which pin the LED is wired. This is certainly configurable in TMK; I haven't tried other firmwares yet.
-
- Main keyboard: Razer Blackwidow Tournament (blue switches)
- Main mouse: Razer Abysuss 2013 with modified LED
- Favorite switch: Cherry MX Blues
- DT Pro Member: -
flabbergast wrote: ↑The easiest way is wiring like this: <pin on teensy> --- LED anode (+) - LED cathode (-) --- resistor --- ground.
The pin on teensy should no be used for anything else (so you'll need a free teensy pin for each LED). Resistor needs to limit the current through LED to that it doesn't take more than 10mA, and altogether all LEDs should take at most cca 50mA (there's a low limit because this way the LEDs take the current from the teensy, through the microcontroller).
This way, the LED lights up when the pin is taken high, and is off when the pin is low. Of course you can put the resistor between the pin and the LED instead; or you can reverse the LED and end in VCC (5V). (That way you can actually let a bit more current through, cca 15mA). For the resistor/current calculations, you can use this.
There are other ways which can be used if you want to power the LEDs directly from the USB current, or if you need to control more LEDs than free teensy pins. But wiring this way is the easiest if you need only a few LEDs.
From the point of the view of the firmware, all it needs to know is to which pin the LED is wired. This is certainly configurable in TMK; I haven't tried other firmwares yet.
Ok thanks for the answer! Just two thing I want to ask:
1. For a 104 key keyboard will I need a tensey ++ to fit all the leds? I only ask because I would like to order it asap but if you dont know i can wire it up and figure it out myself.
2. Do you know of a a build where someone has done this? Just so i can visualize it?
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Yes, you'll need teensy++ for a full-size keyboard. You'll need at least rows+columns+leds free pins on the controller and even rows+cols is already 27.Davsmith4 wrote: ↑ Ok thanks for the answer! Just two thing I want to ask:
1. For a 104 key keyboard will I need a tensey ++ to fit all the leds? I only ask because I would like to order it asap but if you dont know i can wire it up and figure it out myself.
2. Do you know of a a build where someone has done this? Just so i can visualize it?
I haven't seen pics of wiring a full-size keyboard yet - but maybe some gurus here have.
- Nephiel
- Location: Spain
- Main mouse: Silenced Logitech M175
- DT Pro Member: -
You can reduce the number of pins needed if you don't mind rewiring the matrix in a different way. E.g. for a 104-key you could use a matrix of 13x8=104, which uses only 13+8=21 controller pins.
The closer to a square, the more keys you can have; e.g. a matrix of 10x11 allows 110 keys using the same 21 pins.
The Teensy 2.0 has up to 25 i/o pins so in theory you could have a maximum of 110 keys + 4 status LEDs, but it won't be as easy to wire.
The closer to a square, the more keys you can have; e.g. a matrix of 10x11 allows 110 keys using the same 21 pins.
The Teensy 2.0 has up to 25 i/o pins so in theory you could have a maximum of 110 keys + 4 status LEDs, but it won't be as easy to wire.