When you finish this tutorial you will be able to be able to modify a split keybrd sketch with 10 to 24 keys on the peripheral hand.
Only the right matrix is shown. The left matrix was omitted to reduce clutter.
The layout has 2 rows and 7 columns. Electronically, the matrix only has one row. Diodes are not needed because there is only one row.
The two black rectangles are shift registers daisy chained together. Shift register details are in the SN74HC165N datasheet.
Add components to the breadboard as shown in the picture.
Each shift register has a small notch on one end to identify pin 1. In the picture, pin 1s are on the left end. Shift registers are chained together by colored wires that lay flat on the breadboard.
Each shift register has 8 parallel input pins, 4 on each side. There are 14 keys, so 2 of the input pins are unused. Used input pins are connected to 10k pull-down resistor which are grounded (blue bus). Unused input pins are grounded (blue bus).
A decoupling capacitor between the power and ground wires prevents power disturbance.
Switches are connected to power (red bus) and shift register input pins (jumpers).
I apologize for not having a schematic. This table should help you figure out the pictures:
74HC165 left (lower half of breadboard)
NAME PIN# DESCRIPTION TO TEENSY LC PIN# CHAIN
SH/LD 1 shift or load input CS0 10 green wire
CLK 2 clock input SCK0 13 yellow wire
D4 3 parallel input blue bus
D5 4 parallel input blue bus
D6 5 parallel input blue bus
D7 6 parallel input blue bus
/QH 7 ~serial output
GND 8 ground gnd blue bus
74HC165 right (upper half of breadboard)
NAME PIN# DESCRIPTION TO TEENSY LC PIN# CHAIN
VCC 16 power pin 3.3V red wire
CLK INH 15 clock inhibit blue bus
D3 14 parallel input blue bus
D2 13 parallel input blue bus
D1 12 parallel input blue bus
D0 11 parallel input blue bus
SER 10 serial input blue wire to next QH
QH 9 serial output MISO0 12 blue wire to previous SER
keybrd_4b_split_keyboard_with_shift_registers.ino is a simple sketch with two shift registers. The sketch will run on the above breadboard keyboard.
The sketch has code for both left and right matrix. Notice that the left matrix is active low, while the right matrix is active high.
Guess what happens if an unused input pin is not grounded? Try it.
Add a left matrix to Teensy. There is room between Teensy and the shift registers for a 1-column matrix. The bus strips are occupied by the right keys, so use terminal strips instead. Other wise it is similar to the 2-column matrix in tutorial_1_breadboard_keyboard.md.
keybrd tutorial by Wolfram Volpi is licensed under a Creative Commons Attribution 4.0 International License.
Permissions beyond the scope of this license may be available at https://github.com/wolfv6/keybrd/issues/new.