I have been making custom keyboards that only have 24 or fewer keys because the Teensy 2.0 only has 24 pins. I've come to the point where I want to create a keyboard that has a greater number of keys, so I surfed schematics and they have shown me that I have to connect keys in columns and rows. The columns are connected to pins 0 through 10 and the rows are connected to pins 11-21 (with some pins not used on either side). For example, a wire runs from pin 9 through the ALT, Z, A, Q and 1 keys, and each of these keys returns the signal to the Teensy board through connections to pins 12, 13, 14, 15 and 16 respectively. If I press the "Q" key, a circuit is completed from pin 9 to pin 15.
The code that I used to run when my keys were connected directly from pin to ground no longer works for this new configuration. I've wired up a single key, in this case from pin 9 to pin 15, and I want to know how I code the Teensy 2.0 board to recognize it. I've included some generic pictures of how keyboards are wired using Teensy 2.0 so people can see how keys are wired and connected to the board.
Here is a single key example of the code I used to use:
#include <Bounce.h>
Bounce button0 = Bounce(0, 3);
void setup() {
pinMode(0, INPUT_PULLUP);
}
void loop() {
button0.update();
if (button0.fallingEdge()) {
Keyboard.press(KEY_0);
Keyboard.release(KEY_0);
}
}
How do I code this new method of wiring the board? If I could code just 1 key I'd figure out how to do the rest.
.
The code that I used to run when my keys were connected directly from pin to ground no longer works for this new configuration. I've wired up a single key, in this case from pin 9 to pin 15, and I want to know how I code the Teensy 2.0 board to recognize it. I've included some generic pictures of how keyboards are wired using Teensy 2.0 so people can see how keys are wired and connected to the board.
Here is a single key example of the code I used to use:
#include <Bounce.h>
Bounce button0 = Bounce(0, 3);
void setup() {
pinMode(0, INPUT_PULLUP);
}
void loop() {
button0.update();
if (button0.fallingEdge()) {
Keyboard.press(KEY_0);
Keyboard.release(KEY_0);
}
}
How do I code this new method of wiring the board? If I could code just 1 key I'd figure out how to do the rest.
.