All the code.
If you are using a premade pcb with a .json file provided such as a dz60 etc. Please load that .json file into kbfirmware.com and skip to the Keymap and Macro tips and tricks.
Basics of creating your matrix:
One of the easiest ways to do this is to simply import your KLE raw data into kbfirmware.com and have the matrix generated for you. This generally works well enough, but can sometimes be improved upon as it does not always use the smallest number of pins. My preferred method of creating my matrix is to take a screenshot of my KLE layout and simply draw the rows and columns in over the screenshot. I like doing this because I generally save a column or two compared to kbfirmware.com, and can also make some adjustments to make hand wiring easier.
Default wiring diagram for 60% layout from Keyboard-layout-editor.com via the Kbfirmware.com algorithm
Example of wiring diagram made for “easier” hand wiring and saves 1 pin
What pins are and why they are important:
Pins in this context are the number of usable digital I/O outputs on the controllers. Pins are important because they dictate the number of rows and columns you can have in a layout. For every row and column one pin needs to be used per each. So in the examples above 19 (5 rows, 14 columns) and 20 (5 rows, 15 columns) pins are used respectively. The two most popular controller options for handwire and basic custom pcbs are the pro micro and the teensy 2.0 which have 18, and 25 usable pins respectively. What this all boils down to is that having 18 or less pins saves you money, and having 26 or more pins means that you will need to either user some rather involved wiring shenanigans to reduce your pin use, or jump up in price again to the teensy ++ which has 46 usable pins, but is more expensive and not used very much.
Editing your wiring diagrams:
This is pretty straight forward on kbfirmware.com. You simply have to select the key and use the + and - buttons to change the rows or columns. The diode direction should always be “Column to Row” if you are using most pcbs or following all hand-wiring guides I have read (I use a mix of techniques in the “A Modern Handwiring Guide” and “BrownFox step by step”).
If you are using a promicro or teensy controller the ATmega32U4 will be correct setting, if you are using a different controller this might change, but most common ones used by keyboards use the ATmega32U4. For handwire builds I prefer to connect my rows and columns to the controller in a way that makes the length of wire the shortest/most direct. This part of the process is very important to document. After I connect the wires to the controller and document it, you just have to go through and use the drop down menu to change the rows and columns to their proper pin.
Pro Micro pinout