3D Printed Macro Pad

Diodes

Wiring Diagram

Wires

Code

keymap.c

#include "macro.h"

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

    LAYOUT(
                KC_A,       KC_B,       KC_C,       KC_D,
                KC_NUM,     KC_PSLS,    KC_PAST,    KC_PMNS,
                KC_P7,      KC_P8,      KC_P9,      KC_PPLS,
        KC_E,   KC_P4,      KC_P5,      KC_P6,
        KC_F,   KC_P1,      KC_P2,      KC_P3,      KC_PENT,
        KC_G,         KC_P0,            KC_PDOT)            
};

macro.h

#ifndef macro_H
#define macro_H

#include "quantum.h"

#define LAYOUT( \
         K01, K02, K03, K04, \
         K11, K12, K13, K14, \
         K21, K22, K23, K24, \
    K30, K31, K32, K33,      \
    K40, K41, K42, K43, K44, \
    K50,      K52, K53       \
)   { \
    { KC_NO, K01,   K02,   K03,   K04 }, \
    { KC_NO, K11,   K12,   K13,   K14 }, \
    { KC_NO, K21,   K22,   K23,   K24 }, \
    { K30,   K31,   K32,   K33,   KC_NO }, \
    { K40,   K41,   K42,   K43,   K44 }, \
    { K50,   KC_NO, K52,   K53,   KC_NO } \
}

#endif

config.h

#ifndef CONFIG_H
#define CONFIG_H

#include "config_common.h"

#define MATRIX_ROWS 6
#define MATRIX_COLS 5

#define MATRIX_ROW_PINS { D2, D3, C6, C7, D1, D0 }
#define MATRIX_COL_PINS { D7, B6, F7, B5, B4 }
#define UNUSED_PINS

#define DIODE_DIRECTION COL2ROW

#endif

Final Product

Author: Ricardo