Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating old Mad Noodle Keypads, and added support for all Mad Noodle keypads, past and future (upcoming keypad launch) #22685

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
},
"clangd.arguments": [
"--header-insertion=never"
]
],
"cmake.configureOnOpen": false
}
9 changes: 9 additions & 0 deletions keyboards/themadnoodle/ncc1701kb/v2/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2023 Jesse Leventhal (@The=Mad-Noodle)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

/*RGB Defaults*/
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL
#define RGBLIGHT_DEFAULT_SPD 3
/* See info.json for more RGB settings*/
122 changes: 66 additions & 56 deletions keyboards/themadnoodle/ncc1701kb/v2/info.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,69 @@
{
"keyboard_name": "NCC-1701-KB v2",
"manufacturer": "The Mad Noodle",
"url": "instagram.com/the_mad_noodle",
"maintainer": "The-Mad-Noodle",
"usb": {
"vid": "0xFEED",
"pid": "0x1701",
"device_version": "0.0.2"
},
"matrix_pins": {
"cols": ["B4", "B5", "B6"],
"rows": ["D4", "D6", "D7"]
},
"diode_direction": "ROW2COL",
"encoder": {
"rotary": [
{"pin_a": "D0", "pin_b": "D1"}
]
},
"rgblight": {
"led_count": 4,
"sleep": true,
"animations": {
"breathing": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"snake": true,
"knight": true,
"christmas": true,
"static_gradient": true,
"rgb_test": true,
"alternating": true,
"twinkle": true
}
},
"ws2812": {
"pin": "B7"
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"layouts": {
"LAYOUT_ortho_3x3": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 1, "y": 0},
{"matrix": [0, 2], "x": 2, "y": 0},

{"matrix": [1, 0], "x": 0, "y": 1},
{"matrix": [1, 1], "x": 1, "y": 1},
{"matrix": [1, 2], "x": 2, "y": 1},
"manufacturer": "The Mad Noodle",
"keyboard_name": "NCC-1701-KB v2",
"maintainer": "The-Mad-Noodle",
"url": "https://www.madnoodleprototypes.com/",
"bootloader": "atmel-dfu",
"diode_direction": "ROW2COL",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"rgblight": {
"hue_steps": 10,
"led_count": 4,
"sleep": true,
"animations": {
"breathing": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"snake": true,
"knight": true,
"christmas": true,
"static_gradient": true,
"rgb_test": true,
"alternating": true,
"twinkle": true
}
},
"ws2812": {
"pin": "B7"
},
"matrix_pins": {
"rows": ["D4", "D6", "D7"],
"cols": ["B4", "B5", "B6"]
},
"processor": "atmega32u4",
"usb": {
"device_version": "2.0.0",
"pid": "0x0021",
"vid": "0x6A6C"
},
"layouts": {
"LAYOUT_ortho_3x3": {
"layout": [
{"x":0, "y":0, "matrix": [0,0]},
{"label":"Encoder", "x":1, "y":0, "matrix": [0,1]},
{"x":2, "y":0, "matrix": [0,2]},
{"x":0, "y":1, "matrix": [1,0]},
{"x":1, "y":1, "matrix": [1,1]},
{"x":2, "y":1, "matrix": [1,2]},
{"x":0, "y":2, "matrix": [2,0]},
{"x":1, "y":2, "matrix": [2,1]},
{"x":2, "y":2, "matrix": [2,2]}
]
}
},

{"matrix": [2, 0], "x": 0, "y": 2},
{"matrix": [2, 1], "x": 1, "y": 2},
{"matrix": [2, 2], "x": 2, "y": 2}
]
"encoder": {
"enabled": true,
"rotary": [
{ "pin_a": "D0", "pin_b": "D1", "resolution": 4 }
]

}
}
}
}
97 changes: 49 additions & 48 deletions keyboards/themadnoodle/ncc1701kb/v2/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// Copyright 2023 The Mad Noodle(@the_mad_noodle)
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

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

/* LAYER 0
* ,-----------------------.
* | << | MUTE | >> | ENCODER - PRESS (MUTE) / HOLD (LAYER 2) / KNOB (VOLUME CONTROL)
/* LAYER 0
* ,-------|ENCODER|-------.
* | << | MUTE | >> |
* |-------+-------+-------|
* | STOP | PLAY | MEDIA |
* |-------+-------+-------|
Expand All @@ -13,72 +16,70 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/

[0] = LAYOUT_ortho_3x3(
KC_MPRV, LT(2, KC_MUTE), KC_MNXT,
KC_MPRV, LT(2, KC_MUTE), KC_MNXT,
KC_MSTP, KC_MPLY, KC_MSEL,
KC_CALC, KC_MAIL, LT(1, KC_MYCM)
),


/* LAYER 1
* ,-----------------------.
* | MODE+ |RGB TOG| MODE- | ENCODER - PRESS (NA) / KNOB (Hue Control)
/* LAYER 1
* ,-------|ENCODER|-------.
* | MODE+ |RGB TOG| MODE- |
* |-------+-------+-------|
* | SPD- | SPD+ |Bright |
* |Bright-| PLAIN |Bright+|
* |-------+-------+-------|
* | SAT+ | SAT- | |
* | SWIRL |BREATH | |
* `-----------------------'
*/

[1] = LAYOUT_ortho_3x3(
RGB_MOD, RGB_TOG, RGB_RMOD,
RGB_SPI, RGB_SPD, RGB_VAI,
RGB_SAI, RGB_SAD, KC_TRNS
RGB_MOD, RGB_TOG, RGB_RMOD,
RGB_VAD, RGB_M_P, RGB_VAI,
LT(3,RGB_M_SW), RGB_M_B, KC_TRNS
),


/* LAYER 2 (ENCODER)
* ,-----------------------.
* | | | | ENCODER - PRESS (NA) / KNOB (Arrow Left/Right)
/* LAYER 2
* ,-------|ENCODER|-------.
* | | | |
* |-------+-------+-------|
* | | | |
* |-------+-------+-------|
* | | | |
* `-----------------------'
*/

[2] = LAYOUT_ortho_3x3(
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),


/* LAYER 3
* ,-------|ENCODER|-------.
* | | | |
* |-------+-------+-------|
* | | | |
* |-------+-------+-------|
* | | | |
* `-----------------------'
*/

[3] = LAYOUT_ortho_3x3(
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
)

};

bool encoder_update_user(uint8_t index, bool clockwise) {

switch (get_highest_layer(layer_state)) {
case 1:
if (clockwise) {
rgblight_increase_hue();
} else {
rgblight_decrease_hue();
}
break;
case 2:
if (clockwise) {
tap_code(KC_RGHT);
} else {
tap_code(KC_LEFT);
}
break;
default:
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
break;

}
return true;
}
/*Encoder Mapping*/
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[1] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI) },
[2] = { ENCODER_CCW_CW(KC_LEFT, KC_RGHT) },
[3] = { ENCODER_CCW_CW(RGB_SAD, RGB_SAI) },
};
#endif
85 changes: 85 additions & 0 deletions keyboards/themadnoodle/ncc1701kb/v2/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Copyright 2023 The Mad Noodle(@the_mad_noodle)
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

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

/* LAYER 0
* ,-------|ENCODER|-------.
* | << | MUTE | >> |
* |-------+-------+-------|
* | STOP | PLAY | MEDIA |
* |-------+-------+-------|
* | CALC | MY PC | TO(3) |
* `-----------------------'
*/

[0] = LAYOUT_ortho_3x3(
KC_MPRV, KC_MUTE, KC_MNXT,
KC_MSTP, KC_MPLY, KC_MSEL,
KC_CALC, KC_MYCM, TO(3)
),


/* LAYER 1
* ,-------|ENCODER|-------.
* | MODE+ |RGB TOG| MODE- |
* |-------+-------+-------|
* |Bright-| PLAIN |Bright+|
* |-------+-------+-------|
* | SWIRL |BREATH | TO(0) |
* `-----------------------'
*/

[1] = LAYOUT_ortho_3x3(
RGB_MOD, RGB_TOG, RGB_RMOD,
RGB_VAD, RGB_M_P, RGB_VAI,
RGB_M_SW, RGB_M_B, TO(0)
),


/* LAYER 2
* ,-------|ENCODER|-------.
* | | | |
* |-------+-------+-------|
* | | | |
* |-------+-------+-------|
* | | | TO(0) |
* `-----------------------'
*/

[2] = LAYOUT_ortho_3x3(
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, TO(0)
),


/* LAYER 3
* ,-------|ENCODER|-------.
* | | | |
* |-------+-------+-------|
* | TO(1) | | TO(2) |
* |-------+-------+-------|
* | | | TO(0) |
* `-----------------------'
*/

[3] = LAYOUT_ortho_3x3(
KC_TRNS, KC_TRNS, KC_TRNS,
TO(1), KC_TRNS, TO(2),
KC_TRNS, KC_TRNS, TO(0)
)

};

/*Encoder Mapping*/
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
[1] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI)},
[2] = { ENCODER_CCW_CW(RGB_SAD, RGB_SAI)},
[3] = { ENCODER_CCW_CW(KC_UP, KC_DOWN)},
};
#endif
4 changes: 4 additions & 0 deletions keyboards/themadnoodle/ncc1701kb/v2/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is used to override the default rules.mk file
RGBLIGHT_ENABLE = yes
ENCODER_MAP_ENABLE = yes
VIA_ENABLE = yes
Loading