From 9284c6304170eb97b9434677d6e1f75b4558acbc Mon Sep 17 00:00:00 2001 From: rabijl Date: Wed, 9 Aug 2023 19:36:14 +0300 Subject: [PATCH 01/12] rotary_pad: add default numpad layout an initial commit which setups up the initial configurations such as the mcu and pinlayout. --- keyboards/rotary_numpad/config.h | 20 +++++++ keyboards/rotary_numpad/info.json | 53 ++++++++++++++++++ .../rotary_numpad/keymaps/default/keymap.c | 55 +++++++++++++++++++ keyboards/rotary_numpad/readme.md | 38 +++++++++++++ keyboards/rotary_numpad/rules.mk | 1 + 5 files changed, 167 insertions(+) create mode 100644 keyboards/rotary_numpad/config.h create mode 100644 keyboards/rotary_numpad/info.json create mode 100644 keyboards/rotary_numpad/keymaps/default/keymap.c create mode 100644 keyboards/rotary_numpad/readme.md create mode 100644 keyboards/rotary_numpad/rules.mk diff --git a/keyboards/rotary_numpad/config.h b/keyboards/rotary_numpad/config.h new file mode 100644 index 000000000000..6484e22918f2 --- /dev/null +++ b/keyboards/rotary_numpad/config.h @@ -0,0 +1,20 @@ +// Copyright 2023 rabijl (@rabijl) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT diff --git a/keyboards/rotary_numpad/info.json b/keyboards/rotary_numpad/info.json new file mode 100644 index 000000000000..84e4517ff9fb --- /dev/null +++ b/keyboards/rotary_numpad/info.json @@ -0,0 +1,53 @@ +{ + "manufacturer": "rabijl", + "keyboard_name": "rotary_numpad", + "maintainer": "rabijl", + "bootloader": "caterina", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": ["F5", "F4", "B5", "B4"], + "rows": ["F6", "F7", "B1", "B3", "B2", "B6"] + }, + "processor": "atmega32u4", + "url": "", + "usb": { + "device_version": "1.0.0", + "pid": "0x0000", + "vid": "0xFEED" + }, + "layouts": { + "LAYOUT_numpad_6x4": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [2, 3], "x": 3, "y": 2, "h": 2}, + {"matrix": [4, 0], "x": 0, "y": 4}, + {"matrix": [4, 1], "x": 1, "y": 4}, + {"matrix": [4, 2], "x": 2, "y": 4}, + {"matrix": [5, 1], "x": 0, "y": 5, "w": 2}, + {"matrix": [5, 2], "x": 2, "y": 5}, + {"matrix": [4, 3], "x": 3, "y": 4, "h": 2} + ] + } + } +} diff --git a/keyboards/rotary_numpad/keymaps/default/keymap.c b/keyboards/rotary_numpad/keymaps/default/keymap.c new file mode 100644 index 000000000000..3c42f1194846 --- /dev/null +++ b/keyboards/rotary_numpad/keymaps/default/keymap.c @@ -0,0 +1,55 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later +// + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┐ + * │Esc│Tab│MO1│Bsp│ + * ├───┼───┼───┼───┤ + * │Num│ / │ * │ - │ + * ├───┼───┼───┼───┤ + * │ 7 │ 8 │ 9 │ │ + * ├───┼───┼───┤ + │ + * │ 4 │ 5 │ 6 │ │ + * ├───┼───┼───┼───┤ + * │ 1 │ 2 │ 3 │ │ + * ├───┴───┼───┤Ent│ + * │ 0 │ . │ │ + * └───────┴───┴───┘ + */ + [0] = LAYOUT_numpad_6x4( + KC_ESC, KC_TAB, MO(1), KC_BSPC, + KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, + KC_P0, KC_PDOT, KC_PENT + ), + + /* + * ┌───┐───┬───┬───┐ + * │Rst│Tab│MO1│Bsp│ + * └───┘───┼───┼───┤ + * │Num│ / │ * │ - │ + * ┌───┬───┬───┐───┤ + * │Hom│ ↑ │PgU│ │ + * ├───┼───┼───┤ + │ + * │ ← │ │ → │ │ + * ├───┼───┼───┤───┤ + * │End│ ↓ │PgD│ │ + * ├───┴───┼───┤Ent│ + * │Insert │Del│ │ + * └───────┴───┘───┘ + */ + [1] = LAYOUT_numpad_6x4( + QK_BOOT, _______, _______, _______, + _______, _______, _______, _______, + KC_HOME, KC_UP, KC_PGUP, + KC_LEFT, XXXXXXX, KC_RGHT, _______, + KC_END, KC_DOWN, KC_PGDN, + KC_INS, KC_DEL, _______ + ) +}; diff --git a/keyboards/rotary_numpad/readme.md b/keyboards/rotary_numpad/readme.md new file mode 100644 index 000000000000..ce8a47f7d01d --- /dev/null +++ b/keyboards/rotary_numpad/readme.md @@ -0,0 +1,38 @@ +# rotary_numpad + +# TODO: + *[x] set pin numbers in rows/columns in info.json + *[x] check if diodes are column or row + * (optional) add reset switch + *[x] flash bootstrap firmware to test + * add rotory buttons + * add rotor options + * flash updated firmware + * update documentation + * push to git + +![rotary_numpad](imgur.com image replace me!) + +*A short description of the keyboard/project* + +* Keyboard Maintainer: [rabijl](https://github.com/rabijl) +* Hardware Supported: *The PCBs, controllers supported* +* Hardware Availability: *Links to where you can find this hardware* + +Make example for this keyboard (after setting up your build environment): + + make rotary_numpad:default + +Flashing example for this keyboard: + + make rotary_numpad:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/rotary_numpad/rules.mk b/keyboards/rotary_numpad/rules.mk new file mode 100644 index 000000000000..1287472e49e4 --- /dev/null +++ b/keyboards/rotary_numpad/rules.mk @@ -0,0 +1 @@ +# file intentionally left blank From 5ebd0d2f08c3b443c3ceff9f3efedf63eab481d1 Mon Sep 17 00:00:00 2001 From: rabijl Date: Wed, 9 Aug 2023 20:19:57 +0300 Subject: [PATCH 02/12] rotary_pad: add initial rotary functions sets up the three rotary encoders and assigns some functions to them. --- keyboards/rotary_numpad/config.h | 7 +++++ keyboards/rotary_numpad/info.json | 10 ++++++- .../rotary_numpad/keymaps/default/keymap.c | 26 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/keyboards/rotary_numpad/config.h b/keyboards/rotary_numpad/config.h index 6484e22918f2..cba3e2aae6b3 100644 --- a/keyboards/rotary_numpad/config.h +++ b/keyboards/rotary_numpad/config.h @@ -18,3 +18,10 @@ //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT + +// it seems that declaring encoder pins in info.json +// is not working exactly and compilation fails when +// this macro is not set. But it will warn that the +// encoders have been declared twice ¯\_(ツ)_/¯ +#define ENCODERS_PAD_A { D1, D4, D7} +#define ENCODERS_PAD_B { D0, C6, E6} diff --git a/keyboards/rotary_numpad/info.json b/keyboards/rotary_numpad/info.json index 84e4517ff9fb..99c125a07bf1 100644 --- a/keyboards/rotary_numpad/info.json +++ b/keyboards/rotary_numpad/info.json @@ -10,7 +10,8 @@ "console": false, "extrakey": true, "mousekey": true, - "nkro": true + "nkro": true, + "encoder": true }, "matrix_pins": { "cols": ["F5", "F4", "B5", "B4"], @@ -49,5 +50,12 @@ {"matrix": [4, 3], "x": 3, "y": 4, "h": 2} ] } + }, + "encoder": { + "rotary": [ + {"pin_a": "D1", "pin_b": "D0", "resolution": 1}, + {"pin_a": "D4", "pin_b": "C6", "resolution": 1}, + {"pin_a": "D7", "pin_b": "E6", "resolution": 1} + ] } } diff --git a/keyboards/rotary_numpad/keymaps/default/keymap.c b/keyboards/rotary_numpad/keymaps/default/keymap.c index 3c42f1194846..92fdb12858d2 100644 --- a/keyboards/rotary_numpad/keymaps/default/keymap.c +++ b/keyboards/rotary_numpad/keymaps/default/keymap.c @@ -53,3 +53,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_INS, KC_DEL, _______ ) }; + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; /* Don't process further events if user function exists and returns false */ + } + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_UP); + } else { + tap_code(KC_DOWN); + } + }else if (index == 2) { /* Third encoder */ + if (clockwise) { + tap_code(KC_RIGHT); + } else { + tap_code(KC_LEFT); + } + } + return true; +} From 102847fd93731900f8194cc264e1a8f5ea2d5d6a Mon Sep 17 00:00:00 2001 From: rabijl Date: Sat, 12 Aug 2023 16:07:26 +0300 Subject: [PATCH 03/12] rotary_pad: add rotary button funcs and update readme --- keyboards/rotary_numpad/info.json | 9 ++- .../rotary_numpad/keymaps/default/keymap.c | 40 +++++------ keyboards/rotary_numpad/readme.md | 68 +++++++++++++------ 3 files changed, 75 insertions(+), 42 deletions(-) diff --git a/keyboards/rotary_numpad/info.json b/keyboards/rotary_numpad/info.json index 99c125a07bf1..aecf61a9f381 100644 --- a/keyboards/rotary_numpad/info.json +++ b/keyboards/rotary_numpad/info.json @@ -38,16 +38,19 @@ {"matrix": [2, 0], "x": 0, "y": 2}, {"matrix": [2, 1], "x": 1, "y": 2}, {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, {"matrix": [3, 0], "x": 0, "y": 3}, {"matrix": [3, 1], "x": 1, "y": 3}, {"matrix": [3, 2], "x": 2, "y": 3}, - {"matrix": [2, 3], "x": 3, "y": 2, "h": 2}, + {"matrix": [3, 3], "x": 3, "y": 3}, {"matrix": [4, 0], "x": 0, "y": 4}, {"matrix": [4, 1], "x": 1, "y": 4}, {"matrix": [4, 2], "x": 2, "y": 4}, - {"matrix": [5, 1], "x": 0, "y": 5, "w": 2}, + {"matrix": [4, 3], "x": 3, "y": 4}, + {"matrix": [5, 0], "x": 0, "y": 5}, + {"matrix": [5, 1], "x": 1, "y": 5}, {"matrix": [5, 2], "x": 2, "y": 5}, - {"matrix": [4, 3], "x": 3, "y": 4, "h": 2} + {"matrix": [5, 3], "x": 3, "y": 5} ] } }, diff --git a/keyboards/rotary_numpad/keymaps/default/keymap.c b/keyboards/rotary_numpad/keymaps/default/keymap.c index 92fdb12858d2..58e84d5acb56 100644 --- a/keyboards/rotary_numpad/keymaps/default/keymap.c +++ b/keyboards/rotary_numpad/keymaps/default/keymap.c @@ -11,22 +11,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├───┼───┼───┼───┤ * │Num│ / │ * │ - │ * ├───┼───┼───┼───┤ - * │ 7 │ 8 │ 9 │ │ - * ├───┼───┼───┤ + │ - * │ 4 │ 5 │ 6 │ │ + * │ 7 │ 8 │ 9 │ + │ * ├───┼───┼───┼───┤ - * │ 1 │ 2 │ 3 │ │ - * ├───┴───┼───┤Ent│ - * │ 0 │ . │ │ - * └───────┴───┴───┘ + * │ 4 │ 5 │ 6 │ r2│ + * ├───┼───┼───┼───┤ + * │ 1 │ 2 │ 3 │Ent│ + * ├───┼───┼───┼───┤ + * │ r3│ 0 │ . │ r1│ + * └───┴───┴───┴───┘ */ [0] = LAYOUT_numpad_6x4( KC_ESC, KC_TAB, MO(1), KC_BSPC, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, - KC_P7, KC_P8, KC_P9, - KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_P1, KC_P2, KC_P3, - KC_P0, KC_PDOT, KC_PENT + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_ESC, + KC_P1, KC_P2, KC_P3, KC_PENT, + KC_MPLY, KC_P0, KC_PDOT, KC_ENT ), /* @@ -47,10 +47,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [1] = LAYOUT_numpad_6x4( QK_BOOT, _______, _______, _______, _______, _______, _______, _______, - KC_HOME, KC_UP, KC_PGUP, + KC_HOME, KC_UP, KC_PGUP, _______, KC_LEFT, XXXXXXX, KC_RGHT, _______, - KC_END, KC_DOWN, KC_PGDN, - KC_INS, KC_DEL, _______ + KC_END, KC_DOWN, KC_PGDN, _______, + _______, KC_INS, KC_DEL, _______ ) }; @@ -70,12 +70,12 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { } else { tap_code(KC_DOWN); } - }else if (index == 2) { /* Third encoder */ - if (clockwise) { - tap_code(KC_RIGHT); - } else { - tap_code(KC_LEFT); - } + } else if (index == 2) { /* Third encoder */ + if (clockwise) { + tap_code(KC_RIGHT); + } else { + tap_code(KC_LEFT); } + } return true; } diff --git a/keyboards/rotary_numpad/readme.md b/keyboards/rotary_numpad/readme.md index ce8a47f7d01d..56f78be478ee 100644 --- a/keyboards/rotary_numpad/readme.md +++ b/keyboards/rotary_numpad/readme.md @@ -1,31 +1,58 @@ -# rotary_numpad +# Rotary Numpad -# TODO: - *[x] set pin numbers in rows/columns in info.json - *[x] check if diodes are column or row - * (optional) add reset switch - *[x] flash bootstrap firmware to test - * add rotory buttons - * add rotor options - * flash updated firmware - * update documentation - * push to git -![rotary_numpad](imgur.com image replace me!) +![rotary_numpad](https://i.imgur.com/GwEH4WO.jpeg) *A short description of the keyboard/project* * Keyboard Maintainer: [rabijl](https://github.com/rabijl) -* Hardware Supported: *The PCBs, controllers supported* -* Hardware Availability: *Links to where you can find this hardware* +* Hardware Supported: Sparkfun Pro Micro 5V (atmega32u4) +* Hardware Availability: https://www.sparkfun.com/products/12640 -Make example for this keyboard (after setting up your build environment): +This is a personal project of mine where I wanted a number pad that I can put on the left \ +side of keyboard that doesn't have a numberpad. I fell in love with the feel of rotary encoders \ +on my 3d printer, so added three to be able to play around with. - make rotary_numpad:default +## How to build from scratch + +I handsoldered gateron blue switches to a 3D printed case. The design is modified from the [Ultipad](https://www.thingiverse.com/thing:4248565). \ +I used a sparkfun Pro Micro as my microcontroller and the pinout can be found in the `info.json`. I found this [site](https://golem.hu/article/pro-micro-pinout/) \ +to be very useful to identify different pins. You can find useful information on rotary encoders from the qmk docs [here](https://docs.qmk.fm/#/reference_info_json?id=encoders) and [here](https://docs.qmk.fm/#/feature_encoders). + +### matrix + +Due to the three rotary encoders, I had to use most of the available pins. \ +I therefore fit their buttons into 6 x 4 matrix at strange positions. See the diagram below. \ +In this matrix r1, r2 and r3 are the buttons for each respective encoder. + \ +┌───┬───┬───┬───┐ \ +│Esc│Tab│MO1│Bsp│ \ +├───┼───┼───┼───┤ \ +│Num│\/ │ * │ - │ \ +├───┼───┼───┼───┤ \ +│ 7 │ 8 │ 9 │ + │ \ +├───┼───┼───┼───┤ \ +│ 4 │ 5 │ 6 │ r2│ \ +├───┼───┼───┼───┤ \ +│ 1 │ 2 │ 3 │Ent│ \ +├───┼───┼───┼───┤ \ +│ r3│ 0 │ . │ r1│ \ +└───┴───┴───┴───┘ + +## Flashing + +Make example for this keyboard (after setting up your build environment): \ +**note:** you may need to run this in the root of the repository for this to work + + ``` + qmk compile -kb rotary_numpad -km default + ``` Flashing example for this keyboard: - make rotary_numpad:default:flash + ``` + qmk flash -kb rotary_numpad -km default + ``` See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). @@ -33,6 +60,9 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to Enter the bootloader in 3 ways: -* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard -* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Short reset leads**: tab the reset lead to ground twice quickly after qmk is in flash mode * **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available + +**Note:** if the keyboard doesn't show up after putting the keyboard in reset mode, check that +your user is added to the `tty` and/or `uucp` groups. \ +You may need to logout after adding these groups to your user, for the changes to take affect. From 22f77b77bb36a458a16aeda6521c6dd5bfba9589 Mon Sep 17 00:00:00 2001 From: rabijl Date: Sun, 13 Aug 2023 14:31:31 +0300 Subject: [PATCH 04/12] rotary_pad: apply pr changes * removed config.h * changed pic url * changed proc + bl to dev board * renamed LAYOUT_numpad_6x4 to LAYOUT_dense_6x4 --- keyboards/rotary_numpad/config.h | 27 ------------------- keyboards/rotary_numpad/info.json | 5 ++-- .../rotary_numpad/keymaps/default/keymap.c | 4 +-- keyboards/rotary_numpad/readme.md | 2 +- 4 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 keyboards/rotary_numpad/config.h diff --git a/keyboards/rotary_numpad/config.h b/keyboards/rotary_numpad/config.h deleted file mode 100644 index cba3e2aae6b3..000000000000 --- a/keyboards/rotary_numpad/config.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 rabijl (@rabijl) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT - -// it seems that declaring encoder pins in info.json -// is not working exactly and compilation fails when -// this macro is not set. But it will warn that the -// encoders have been declared twice ¯\_(ツ)_/¯ -#define ENCODERS_PAD_A { D1, D4, D7} -#define ENCODERS_PAD_B { D0, C6, E6} diff --git a/keyboards/rotary_numpad/info.json b/keyboards/rotary_numpad/info.json index aecf61a9f381..0b49f6292722 100644 --- a/keyboards/rotary_numpad/info.json +++ b/keyboards/rotary_numpad/info.json @@ -2,7 +2,7 @@ "manufacturer": "rabijl", "keyboard_name": "rotary_numpad", "maintainer": "rabijl", - "bootloader": "caterina", + "development_board": "promicro", "diode_direction": "COL2ROW", "features": { "bootmagic": true, @@ -17,7 +17,6 @@ "cols": ["F5", "F4", "B5", "B4"], "rows": ["F6", "F7", "B1", "B3", "B2", "B6"] }, - "processor": "atmega32u4", "url": "", "usb": { "device_version": "1.0.0", @@ -25,7 +24,7 @@ "vid": "0xFEED" }, "layouts": { - "LAYOUT_numpad_6x4": { + "LAYOUT_dense_6x4": { "layout": [ {"matrix": [0, 0], "x": 0, "y": 0}, {"matrix": [0, 1], "x": 1, "y": 0}, diff --git a/keyboards/rotary_numpad/keymaps/default/keymap.c b/keyboards/rotary_numpad/keymaps/default/keymap.c index 58e84d5acb56..0b59ef30462d 100644 --- a/keyboards/rotary_numpad/keymaps/default/keymap.c +++ b/keyboards/rotary_numpad/keymaps/default/keymap.c @@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ r3│ 0 │ . │ r1│ * └───┴───┴───┴───┘ */ - [0] = LAYOUT_numpad_6x4( + [0] = LAYOUT_dense_6x4( KC_ESC, KC_TAB, MO(1), KC_BSPC, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, KC_P7, KC_P8, KC_P9, KC_PPLS, @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Insert │Del│ │ * └───────┴───┘───┘ */ - [1] = LAYOUT_numpad_6x4( + [1] = LAYOUT_dense_6x4( QK_BOOT, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_UP, KC_PGUP, _______, diff --git a/keyboards/rotary_numpad/readme.md b/keyboards/rotary_numpad/readme.md index 56f78be478ee..68fcf12b7d9d 100644 --- a/keyboards/rotary_numpad/readme.md +++ b/keyboards/rotary_numpad/readme.md @@ -1,7 +1,7 @@ # Rotary Numpad -![rotary_numpad](https://i.imgur.com/GwEH4WO.jpeg) +![rotary_numpad](https://i.imgur.com/GwEH4WOh.jpeg) *A short description of the keyboard/project* From 1de66f2c64e4a5087b7cd33b3dfac51a32fcbec3 Mon Sep 17 00:00:00 2001 From: rabijl Date: Sun, 13 Aug 2023 20:54:45 +0300 Subject: [PATCH 05/12] rotary_pad: apply more accurate layout --- keyboards/rotary_numpad/info.json | 79 ++++++++++--------- .../rotary_numpad/keymaps/default/keymap.c | 4 +- 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/keyboards/rotary_numpad/info.json b/keyboards/rotary_numpad/info.json index 0b49f6292722..ae1c05ab2ab7 100644 --- a/keyboards/rotary_numpad/info.json +++ b/keyboards/rotary_numpad/info.json @@ -2,8 +2,12 @@ "manufacturer": "rabijl", "keyboard_name": "rotary_numpad", "maintainer": "rabijl", - "development_board": "promicro", - "diode_direction": "COL2ROW", + "url": "", + "usb": { + "device_version": "1.0.0", + "pid": "0x0000", + "vid": "0xFEED" + }, "features": { "bootmagic": true, "command": false, @@ -13,51 +17,50 @@ "nkro": true, "encoder": true }, + "development_board": "promicro", + "diode_direction": "COL2ROW", "matrix_pins": { "cols": ["F5", "F4", "B5", "B4"], "rows": ["F6", "F7", "B1", "B3", "B2", "B6"] }, - "url": "", - "usb": { - "device_version": "1.0.0", - "pid": "0x0000", - "vid": "0xFEED" - }, - "layouts": { - "LAYOUT_dense_6x4": { - "layout": [ - {"matrix": [0, 0], "x": 0, "y": 0}, - {"matrix": [0, 1], "x": 1, "y": 0}, - {"matrix": [0, 2], "x": 2, "y": 0}, - {"matrix": [0, 3], "x": 3, "y": 0}, - {"matrix": [1, 0], "x": 0, "y": 1}, - {"matrix": [1, 1], "x": 1, "y": 1}, - {"matrix": [1, 2], "x": 2, "y": 1}, - {"matrix": [1, 3], "x": 3, "y": 1}, - {"matrix": [2, 0], "x": 0, "y": 2}, - {"matrix": [2, 1], "x": 1, "y": 2}, - {"matrix": [2, 2], "x": 2, "y": 2}, - {"matrix": [2, 3], "x": 3, "y": 2}, - {"matrix": [3, 0], "x": 0, "y": 3}, - {"matrix": [3, 1], "x": 1, "y": 3}, - {"matrix": [3, 2], "x": 2, "y": 3}, - {"matrix": [3, 3], "x": 3, "y": 3}, - {"matrix": [4, 0], "x": 0, "y": 4}, - {"matrix": [4, 1], "x": 1, "y": 4}, - {"matrix": [4, 2], "x": 2, "y": 4}, - {"matrix": [4, 3], "x": 3, "y": 4}, - {"matrix": [5, 0], "x": 0, "y": 5}, - {"matrix": [5, 1], "x": 1, "y": 5}, - {"matrix": [5, 2], "x": 2, "y": 5}, - {"matrix": [5, 3], "x": 3, "y": 5} - ] - } - }, "encoder": { "rotary": [ {"pin_a": "D1", "pin_b": "D0", "resolution": 1}, {"pin_a": "D4", "pin_b": "C6", "resolution": 1}, {"pin_a": "D7", "pin_b": "E6", "resolution": 1} ] + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [5, 0],"x":0, "y":0.4}, + {"matrix": [0, 0], "x":2, "y":0}, + {"matrix": [0, 1], "x":3, "y":0}, + {"matrix": [0, 2], "x":4, "y":0}, + {"matrix": [0, 3], "x":5, "y":0}, + {"matrix": [1, 0], "x":2, "y":1.25}, + {"matrix": [1, 1], "x":3, "y":1.25}, + {"matrix": [1, 2], "x":4, "y":1.25}, + {"matrix": [1, 3], "x":5, "y":1.25}, + {"matrix": [2, 0], "x":2, "y":2.25}, + {"matrix": [2, 1], "x":3, "y":2.25}, + {"matrix": [2, 2], "x":4, "y":2.25}, + {"matrix": [2, 3], "x":5, "y":2.25, "h":2}, + + {"matrix": [3, 3], "x":0, "y":2.75}, + {"matrix": [3, 0], "x":2, "y":3.25}, + {"matrix": [3, 1], "x":3, "y":3.25}, + {"matrix": [3, 2], "x":4, "y":3.25}, + + {"matrix": [4, 0], "x":2, "y":4.25}, + {"matrix": [4, 1], "x":3, "y":4.25}, + {"matrix": [4, 2], "x":4, "y":4.25}, + {"matrix": [4, 3], "x":5, "y":4.25, "h":2}, + + {"matrix": [5, 3], "x":0, "y":5.05}, + {"matrix": [5, 1], "x":2, "y":5.25, "w":2}, + {"matrix": [5, 2], "x":4, "y":5.25} + ] + } } } diff --git a/keyboards/rotary_numpad/keymaps/default/keymap.c b/keyboards/rotary_numpad/keymaps/default/keymap.c index 0b59ef30462d..7ad7f65d3e57 100644 --- a/keyboards/rotary_numpad/keymaps/default/keymap.c +++ b/keyboards/rotary_numpad/keymaps/default/keymap.c @@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ r3│ 0 │ . │ r1│ * └───┴───┴───┴───┘ */ - [0] = LAYOUT_dense_6x4( + [0] = LAYOUT( KC_ESC, KC_TAB, MO(1), KC_BSPC, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, KC_P7, KC_P8, KC_P9, KC_PPLS, @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Insert │Del│ │ * └───────┴───┘───┘ */ - [1] = LAYOUT_dense_6x4( + [1] = LAYOUT( QK_BOOT, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_UP, KC_PGUP, _______, From 903028106154d8309d7880974b7e8cf68538f582 Mon Sep 17 00:00:00 2001 From: rabijl Date: Mon, 14 Aug 2023 09:16:26 +0300 Subject: [PATCH 06/12] rotary_pad: fix layout and enable encoder mapping * also updated readme with new diagram --- keyboards/rotary_numpad/info.json | 3 +- .../rotary_numpad/keymaps/default/keymap.c | 88 ++++++++++--------- keyboards/rotary_numpad/readme.md | 34 +++---- 3 files changed, 67 insertions(+), 58 deletions(-) diff --git a/keyboards/rotary_numpad/info.json b/keyboards/rotary_numpad/info.json index ae1c05ab2ab7..fa5ae1a0c4ab 100644 --- a/keyboards/rotary_numpad/info.json +++ b/keyboards/rotary_numpad/info.json @@ -15,7 +15,8 @@ "extrakey": true, "mousekey": true, "nkro": true, - "encoder": true + "encoder": true, + "encoder_map": true }, "development_board": "promicro", "diode_direction": "COL2ROW", diff --git a/keyboards/rotary_numpad/keymaps/default/keymap.c b/keyboards/rotary_numpad/keymaps/default/keymap.c index 7ad7f65d3e57..5b32f66e1c32 100644 --- a/keyboards/rotary_numpad/keymaps/default/keymap.c +++ b/keyboards/rotary_numpad/keymaps/default/keymap.c @@ -5,55 +5,62 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - * ┌───┬───┬───┬───┐ - * │Esc│Tab│MO1│Bsp│ - * ├───┼───┼───┼───┤ - * │Num│ / │ * │ - │ - * ├───┼───┼───┼───┤ - * │ 7 │ 8 │ 9 │ + │ - * ├───┼───┼───┼───┤ - * │ 4 │ 5 │ 6 │ r2│ - * ├───┼───┼───┼───┤ - * │ 1 │ 2 │ 3 │Ent│ - * ├───┼───┼───┼───┤ - * │ r3│ 0 │ . │ r1│ - * └───┴───┴───┴───┘ + /* + * ┌───┐┌───┬───┬───┬───┐ + * │Ply││Esc│Tab│MO1│Bsp│ + * └───┘├───┼───┼───┼───┤ + * │Num│ / │ * │ - │ + * ├───┼───┼───┼───┤ + * │ 7 │ 8 │ 9 │ │ + * ┌───┐├───┼───┼───┤ + │ + * │Esc││ 4 │ 5 │ 6 │ │ + * └───┘├───┼───┼───┼───┤ + * │ 1 │ 2 │ 3 │ │ + * ┌───┐├───┼───┼───┤Ent│ + * │ENT││ 0 │ . │ │ + * └───┘└───┴───┴───┴───┘ */ [0] = LAYOUT( - KC_ESC, KC_TAB, MO(1), KC_BSPC, - KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, - KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_P4, KC_P5, KC_P6, KC_ESC, - KC_P1, KC_P2, KC_P3, KC_PENT, - KC_MPLY, KC_P0, KC_PDOT, KC_ENT + KC_MPLY, KC_ESC, KC_TAB, MO(1), KC_BSPC, + KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_ESC, KC_P4, KC_P5, KC_P6, + KC_P1, KC_P2, KC_P3, KC_PENT, + KC_ENT, KC_P0, KC_PDOT ), - /* - * ┌───┐───┬───┬───┐ - * │Rst│Tab│MO1│Bsp│ - * └───┘───┼───┼───┤ - * │Num│ / │ * │ - │ - * ┌───┬───┬───┐───┤ - * │Hom│ ↑ │PgU│ │ - * ├───┼───┼───┤ + │ - * │ ← │ │ → │ │ - * ├───┼───┼───┤───┤ - * │End│ ↓ │PgD│ │ - * ├───┴───┼───┤Ent│ - * │Insert │Del│ │ - * └───────┴───┘───┘ + * ┌───┐┌───┬───┬───┬───┐ + * │Ply││Rst│Tab│MO1│Bsp│ + * └───┘├───┼───┼───┼───┤ + * │Num│ / │ * │ - │ + * ├───┼───┼───┼───┤ + * │Hom│ ↑ │PgU│ │ + * ┌───┐├───┼───┼───┤ + │ + * │Esc││ ← │ │ → │ │ + * └───┘├───┼───┼───┼───┤ + * │End│ ↓ │PgD│ │ + * ┌───┐├───┴───┼───┤Ent│ + * │ENT││Insert │Del│ │ + * └───┘└───────┴───┘───┘ */ [1] = LAYOUT( - QK_BOOT, _______, _______, _______, - _______, _______, _______, _______, - KC_HOME, KC_UP, KC_PGUP, _______, - KC_LEFT, XXXXXXX, KC_RGHT, _______, - KC_END, KC_DOWN, KC_PGDN, _______, - _______, KC_INS, KC_DEL, _______ + _______, QK_BOOT, _______, _______, _______, + _______, _______, _______, _______, + KC_HOME, KC_UP, KC_PGUP, _______, + _______, KC_LEFT, KC_NO, KC_RGHT, + KC_END, KC_DOWN, KC_PGDN, _______, + _______, KC_INS, KC_DEL ) }; +#if defined(ENCODER_MAP_ENABLE) + +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_DOWN, KC_UP), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT) }, + [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(_______, _______) }, +}; +#else + bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; /* Don't process further events if user function exists and returns false */ @@ -79,3 +86,4 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { } return true; } +#endif diff --git a/keyboards/rotary_numpad/readme.md b/keyboards/rotary_numpad/readme.md index 68fcf12b7d9d..825e87953855 100644 --- a/keyboards/rotary_numpad/readme.md +++ b/keyboards/rotary_numpad/readme.md @@ -21,23 +21,23 @@ to be very useful to identify different pins. You can find useful information on ### matrix -Due to the three rotary encoders, I had to use most of the available pins. \ -I therefore fit their buttons into 6 x 4 matrix at strange positions. See the diagram below. \ -In this matrix r1, r2 and r3 are the buttons for each respective encoder. - \ -┌───┬───┬───┬───┐ \ -│Esc│Tab│MO1│Bsp│ \ -├───┼───┼───┼───┤ \ -│Num│\/ │ * │ - │ \ -├───┼───┼───┼───┤ \ -│ 7 │ 8 │ 9 │ + │ \ -├───┼───┼───┼───┤ \ -│ 4 │ 5 │ 6 │ r2│ \ -├───┼───┼───┼───┤ \ -│ 1 │ 2 │ 3 │Ent│ \ -├───┼───┼───┼───┤ \ -│ r3│ 0 │ . │ r1│ \ -└───┴───┴───┴───┘ +Due to the three rotary encoders, I had to use most of the available pins. Fortunately, all the buttons still fit in a 6x4 matrix. Looking at the diagram below, the three buttons in the first column correspond to each encoder button. + +``` +┌───┐┌───┬───┬───┬───┐ +│Ply││Esc│Tab│MO1│Bsp│ +└───┘├───┼───┼───┼───┤ + │Num│ / │ * │ - │ + ├───┼───┼───┼───┤ + │ 7 │ 8 │ 9 │ │ +┌───┐├───┼───┼───┤ + │ +│Esc││ 4 │ 5 │ 6 │ │ +└───┘├───┼───┼───┼───┤ + │ 1 │ 2 │ 3 │ │ +┌───┐├───┼───┼───┤Ent│ +│Ent││ 0 │ . │ │ +└───┘└───┴───┴───┴───┘ +``` ## Flashing From d49b579aa37cc8096e82d7c58675586aaf9f69df Mon Sep 17 00:00:00 2001 From: RABijl Date: Mon, 14 Aug 2023 17:13:13 +0300 Subject: [PATCH 07/12] rotary_pad: remove encoder callback and tidy readme Co-authored-by: Duncan Sutherland --- .../rotary_numpad/keymaps/default/keymap.c | 27 ------------------- keyboards/rotary_numpad/readme.md | 18 ++++--------- 2 files changed, 5 insertions(+), 40 deletions(-) diff --git a/keyboards/rotary_numpad/keymaps/default/keymap.c b/keyboards/rotary_numpad/keymaps/default/keymap.c index 5b32f66e1c32..f57a1e9a0ab8 100644 --- a/keyboards/rotary_numpad/keymaps/default/keymap.c +++ b/keyboards/rotary_numpad/keymaps/default/keymap.c @@ -59,31 +59,4 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_DOWN, KC_UP), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT) }, [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(_______, _______) }, }; -#else - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; /* Don't process further events if user function exists and returns false */ - } - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } else if (index == 1) { /* Second encoder */ - if (clockwise) { - tap_code(KC_UP); - } else { - tap_code(KC_DOWN); - } - } else if (index == 2) { /* Third encoder */ - if (clockwise) { - tap_code(KC_RIGHT); - } else { - tap_code(KC_LEFT); - } - } - return true; -} #endif diff --git a/keyboards/rotary_numpad/readme.md b/keyboards/rotary_numpad/readme.md index 825e87953855..df192adfac24 100644 --- a/keyboards/rotary_numpad/readme.md +++ b/keyboards/rotary_numpad/readme.md @@ -3,16 +3,12 @@ ![rotary_numpad](https://i.imgur.com/GwEH4WOh.jpeg) -*A short description of the keyboard/project* +This is a personal project of mine where I wanted a number pad that I can put on the left side of keyboard that doesn't have a numberpad. I fell in love with the feel of rotary encoders on my 3d printer, so added three to be able to play around with. * Keyboard Maintainer: [rabijl](https://github.com/rabijl) * Hardware Supported: Sparkfun Pro Micro 5V (atmega32u4) * Hardware Availability: https://www.sparkfun.com/products/12640 -This is a personal project of mine where I wanted a number pad that I can put on the left \ -side of keyboard that doesn't have a numberpad. I fell in love with the feel of rotary encoders \ -on my 3d printer, so added three to be able to play around with. - ## How to build from scratch I handsoldered gateron blue switches to a 3D printed case. The design is modified from the [Ultipad](https://www.thingiverse.com/thing:4248565). \ @@ -41,18 +37,14 @@ Due to the three rotary encoders, I had to use most of the available pins. Fortu ## Flashing -Make example for this keyboard (after setting up your build environment): \ -**note:** you may need to run this in the root of the repository for this to work +Make example for this keyboard (after setting up your build environment): - ``` - qmk compile -kb rotary_numpad -km default - ``` + qmk compile -kb rotary_numpad -km default Flashing example for this keyboard: - ``` - qmk flash -kb rotary_numpad -km default - ``` + qmk flash -kb rotary_numpad -km default + See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). From f2a83600d86dfdf3f932c6bfe10058b52089bea5 Mon Sep 17 00:00:00 2001 From: rabijl Date: Tue, 15 Aug 2023 22:45:58 +0300 Subject: [PATCH 08/12] rotary_pad: move to handwired and apply conventions * keyboard is now under keyboards/handwired/rabijl/rotary_numpad * encoder mapping is now enabled per keymap * add bootmagic reboot instruction * update readme for new location * update keymatrix in readme --- .../rabijl}/rotary_numpad/info.json | 5 +-- .../rotary_numpad/keymaps/default/config.h | 2 + .../rotary_numpad/keymaps/default/keymap.c | 5 ++- .../rabijl}/rotary_numpad/readme.md | 43 +++++++++++-------- .../rabijl}/rotary_numpad/rules.mk | 0 5 files changed, 32 insertions(+), 23 deletions(-) rename keyboards/{ => handwired/rabijl}/rotary_numpad/info.json (97%) create mode 100644 keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h rename keyboards/{ => handwired/rabijl}/rotary_numpad/keymaps/default/keymap.c (94%) rename keyboards/{ => handwired/rabijl}/rotary_numpad/readme.md (58%) rename keyboards/{ => handwired/rabijl}/rotary_numpad/rules.mk (100%) diff --git a/keyboards/rotary_numpad/info.json b/keyboards/handwired/rabijl/rotary_numpad/info.json similarity index 97% rename from keyboards/rotary_numpad/info.json rename to keyboards/handwired/rabijl/rotary_numpad/info.json index fa5ae1a0c4ab..3df7f0a61ad5 100644 --- a/keyboards/rotary_numpad/info.json +++ b/keyboards/handwired/rabijl/rotary_numpad/info.json @@ -2,7 +2,7 @@ "manufacturer": "rabijl", "keyboard_name": "rotary_numpad", "maintainer": "rabijl", - "url": "", + "url": "https://github.com/RABijl/", "usb": { "device_version": "1.0.0", "pid": "0x0000", @@ -15,8 +15,7 @@ "extrakey": true, "mousekey": true, "nkro": true, - "encoder": true, - "encoder_map": true + "encoder": true }, "development_board": "promicro", "diode_direction": "COL2ROW", diff --git a/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h new file mode 100644 index 000000000000..836a4c5df8c6 --- /dev/null +++ b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h @@ -0,0 +1,2 @@ + +#define ENCODER_MAP_ENABLE diff --git a/keyboards/rotary_numpad/keymaps/default/keymap.c b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/keymap.c similarity index 94% rename from keyboards/rotary_numpad/keymaps/default/keymap.c rename to keyboards/handwired/rabijl/rotary_numpad/keymaps/default/keymap.c index f57a1e9a0ab8..24c473682b85 100644 --- a/keyboards/rotary_numpad/keymaps/default/keymap.c +++ b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/keymap.c @@ -3,6 +3,7 @@ // #include QMK_KEYBOARD_H +#include "config.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* @@ -16,9 +17,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Esc││ 4 │ 5 │ 6 │ │ * └───┘├───┼───┼───┼───┤ * │ 1 │ 2 │ 3 │ │ - * ┌───┐├───┼───┼───┤Ent│ + * ┌───┐├───┴───┼───┤Ent│ * │ENT││ 0 │ . │ │ - * └───┘└───┴───┴───┴───┘ + * └───┘└───────┴───┴───┘ */ [0] = LAYOUT( KC_MPLY, KC_ESC, KC_TAB, MO(1), KC_BSPC, diff --git a/keyboards/rotary_numpad/readme.md b/keyboards/handwired/rabijl/rotary_numpad/readme.md similarity index 58% rename from keyboards/rotary_numpad/readme.md rename to keyboards/handwired/rabijl/rotary_numpad/readme.md index df192adfac24..6eb2e1480f56 100644 --- a/keyboards/rotary_numpad/readme.md +++ b/keyboards/handwired/rabijl/rotary_numpad/readme.md @@ -20,31 +20,37 @@ to be very useful to identify different pins. You can find useful information on Due to the three rotary encoders, I had to use most of the available pins. Fortunately, all the buttons still fit in a 6x4 matrix. Looking at the diagram below, the three buttons in the first column correspond to each encoder button. ``` -┌───┐┌───┬───┬───┬───┐ -│Ply││Esc│Tab│MO1│Bsp│ -└───┘├───┼───┼───┼───┤ - │Num│ / │ * │ - │ - ├───┼───┼───┼───┤ - │ 7 │ 8 │ 9 │ │ -┌───┐├───┼───┼───┤ + │ -│Esc││ 4 │ 5 │ 6 │ │ -└───┘├───┼───┼───┼───┤ - │ 1 │ 2 │ 3 │ │ -┌───┐├───┼───┼───┤Ent│ -│Ent││ 0 │ . │ │ -└───┘└───┴───┴───┴───┘ + ┌──┐┌──┐┌──┐┌──┐ + │0A││0B││0C││0D│ +┌──┐ └──┘└──┘└──┘└──┘ +│5A│ +└──┘ ┌──┐┌──┐┌──┐┌──┐ + │1A││1B││1C││1D│ + └──┘└──┘└──┘└──┘ + ┌──┐┌──┐┌──┐┌──┐ + │2A││2B││2C││2D│ +┌──┐ └──┘└──┘└──┘│ │ +│3D│ ┌──┐┌──┐┌──┐│ │ +└──┘ │3A││3B││3C││ │ + └──┘└──┘└──┘└──┘ + ┌──┐┌──┐┌──┐┌──┐ + │4A││4B││4C││4D│ + └──┘└──┘└──┘│ │ +┌──┐ ┌──────┐┌──┐│ │ +│5D│ │5B ││5C││ │ +└──┘ └──────┘└──┘└──┘ + ``` ## Flashing Make example for this keyboard (after setting up your build environment): - qmk compile -kb rotary_numpad -km default + qmk compile -kb handwired/rabijl/rotary_numpad -km default Flashing example for this keyboard: - qmk flash -kb rotary_numpad -km default - + qmk flash -kb handwired/rabijl/rotary_numpad -km default See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). @@ -52,8 +58,9 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to Enter the bootloader in 3 ways: -* **Short reset leads**: tab the reset lead to ground twice quickly after qmk is in flash mode -* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available +* **Short reset leads**: tap the reset lead to ground twice quickly after qmk is in flash mode +* **Keycode in layout**: double tap the key mapped to `QK_BOOT`. On the default keymap this can be found by holding in key (0,C) and tapping key (0,A), see the matrix section for the positions of these keys. +* **Bootmagic reset**: Hold down the key at (0,A) in the matrix (see matrix section) and plug in the keyboard **Note:** if the keyboard doesn't show up after putting the keyboard in reset mode, check that your user is added to the `tty` and/or `uucp` groups. \ diff --git a/keyboards/rotary_numpad/rules.mk b/keyboards/handwired/rabijl/rotary_numpad/rules.mk similarity index 100% rename from keyboards/rotary_numpad/rules.mk rename to keyboards/handwired/rabijl/rotary_numpad/rules.mk From f785f4fb908d78546f55e90c2a33c3c86598a5c6 Mon Sep 17 00:00:00 2001 From: rabijl Date: Tue, 15 Aug 2023 22:29:35 +0300 Subject: [PATCH 09/12] rotary_pad: increase encoder resolution more smooth usage and removes chatter --- keyboards/handwired/rabijl/rotary_numpad/info.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/handwired/rabijl/rotary_numpad/info.json b/keyboards/handwired/rabijl/rotary_numpad/info.json index 3df7f0a61ad5..4a4eff714b99 100644 --- a/keyboards/handwired/rabijl/rotary_numpad/info.json +++ b/keyboards/handwired/rabijl/rotary_numpad/info.json @@ -25,9 +25,9 @@ }, "encoder": { "rotary": [ - {"pin_a": "D1", "pin_b": "D0", "resolution": 1}, - {"pin_a": "D4", "pin_b": "C6", "resolution": 1}, - {"pin_a": "D7", "pin_b": "E6", "resolution": 1} + {"pin_a": "D1", "pin_b": "D0", "resolution": 3}, + {"pin_a": "D4", "pin_b": "C6", "resolution": 3}, + {"pin_a": "D7", "pin_b": "E6", "resolution": 3} ] }, "layouts": { From 3a5ff1599f9f8070d96de631addfbe31051af758 Mon Sep 17 00:00:00 2001 From: RABijl Date: Wed, 16 Aug 2023 05:55:48 +0000 Subject: [PATCH 10/12] add license to config.h --- .../handwired/rabijl/rotary_numpad/keymaps/default/config.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h index 836a4c5df8c6..a5219db96d2c 100644 --- a/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h +++ b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h @@ -1,2 +1,5 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later +// #define ENCODER_MAP_ENABLE From b2ec135a5464ee07a08efac93f5484e186182cc6 Mon Sep 17 00:00:00 2001 From: rabijl Date: Wed, 16 Aug 2023 11:36:40 +0300 Subject: [PATCH 11/12] rotary_pad: switch to rules.mk for keymap --- .../handwired/rabijl/rotary_numpad/keymaps/default/config.h | 5 ----- .../handwired/rabijl/rotary_numpad/keymaps/default/keymap.c | 1 - .../handwired/rabijl/rotary_numpad/keymaps/default/rules.mk | 2 ++ 3 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h create mode 100644 keyboards/handwired/rabijl/rotary_numpad/keymaps/default/rules.mk diff --git a/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h deleted file mode 100644 index a5219db96d2c..000000000000 --- a/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/config.h +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2023 QMK -// SPDX-License-Identifier: GPL-2.0-or-later -// - -#define ENCODER_MAP_ENABLE diff --git a/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/keymap.c b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/keymap.c index 24c473682b85..d4462243b0b3 100644 --- a/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/keymap.c +++ b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/keymap.c @@ -3,7 +3,6 @@ // #include QMK_KEYBOARD_H -#include "config.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* diff --git a/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/rules.mk b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/rules.mk new file mode 100644 index 000000000000..34789bf1728c --- /dev/null +++ b/keyboards/handwired/rabijl/rotary_numpad/keymaps/default/rules.mk @@ -0,0 +1,2 @@ + +ENCODER_MAP_ENABLE = yes From 1cca5a4ce19dd2a215398a4176e2483c1f3ab352 Mon Sep 17 00:00:00 2001 From: RABijl Date: Thu, 17 Aug 2023 05:58:02 +0000 Subject: [PATCH 12/12] tab to space info.json Co-authored-by: Drashna Jaelre --- keyboards/handwired/rabijl/rotary_numpad/info.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/handwired/rabijl/rotary_numpad/info.json b/keyboards/handwired/rabijl/rotary_numpad/info.json index 4a4eff714b99..dafeec0fc01d 100644 --- a/keyboards/handwired/rabijl/rotary_numpad/info.json +++ b/keyboards/handwired/rabijl/rotary_numpad/info.json @@ -24,11 +24,11 @@ "rows": ["F6", "F7", "B1", "B3", "B2", "B6"] }, "encoder": { - "rotary": [ - {"pin_a": "D1", "pin_b": "D0", "resolution": 3}, - {"pin_a": "D4", "pin_b": "C6", "resolution": 3}, - {"pin_a": "D7", "pin_b": "E6", "resolution": 3} - ] + "rotary": [ + {"pin_a": "D1", "pin_b": "D0", "resolution": 3}, + {"pin_a": "D4", "pin_b": "C6", "resolution": 3}, + {"pin_a": "D7", "pin_b": "E6", "resolution": 3} + ] }, "layouts": { "LAYOUT": {