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

[ Add Macropad 6Pad ] #23099

Merged
merged 33 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f1215f1
[ Add Macropad 6Pad ]
zahranetme Feb 17, 2024
8fe48a1
Update info.json
zlabkeeb Feb 17, 2024
2487dd9
Update keyboards/zlabkeeb/6pad/info.json
zlabkeeb Feb 17, 2024
92b34ed
Update keyboards/zlabkeeb/6pad/keymaps/default/keymap.c
zlabkeeb Feb 19, 2024
6808d85
Update keyboards/zlabkeeb/6pad/keymaps/via/keymap.c
zlabkeeb Feb 19, 2024
cc94d05
Update keyboards/zlabkeeb/6pad/rules.mk
zlabkeeb Feb 19, 2024
41c33d4
Merge branch 'master' into master
zlabkeeb Feb 20, 2024
07d7751
Merge branch 'master' into master
zlabkeeb Feb 22, 2024
2dda275
Update info.json Led Count : 4
zlabkeeb Feb 23, 2024
836b160
Merge branch 'master' into master
zlabkeeb Feb 28, 2024
19b69a9
Merge branch 'master' into master
zlabkeeb Mar 2, 2024
abf843f
Merge branch 'master' into master
zlabkeeb Mar 2, 2024
529461c
Merge branch 'master' into master
zlabkeeb Mar 5, 2024
0abf4ca
Merge branch 'master' into master
zlabkeeb Mar 8, 2024
98fd078
Merge branch 'master' into master
zlabkeeb Mar 8, 2024
df5e924
Merge branch 'master' into master
zlabkeeb Mar 8, 2024
ecfea51
Merge branch 'master' into master
zlabkeeb Mar 8, 2024
667a73a
Merge branch 'master' into master
zlabkeeb Mar 9, 2024
e2d6886
Merge branch 'master' into master
zlabkeeb Mar 9, 2024
8a3c414
Merge branch 'master' into master
zlabkeeb Mar 10, 2024
110c9c6
Merge branch 'master' into master
zlabkeeb Mar 13, 2024
1491885
Update keyboards/zlabkeeb/6pad/keymaps/default/keymap.c
zlabkeeb Mar 13, 2024
fcb022d
Update keyboards/zlabkeeb/6pad/keymaps/via/keymap.c
zlabkeeb Mar 13, 2024
1501008
Update
zlabkeeb Mar 13, 2024
7fb1215
Merge branch 'master' into master
zlabkeeb Mar 13, 2024
c4ccc11
Update readme.md
zlabkeeb Mar 13, 2024
1c5b38f
Update keyboards/zlabkeeb/6pad/rev1/info.json
zlabkeeb Mar 13, 2024
26777ec
Merge branch 'master' into master
zlabkeeb Mar 14, 2024
8294d9d
Update
zlabkeeb Mar 17, 2024
92c4cec
Update readme
zlabkeeb Mar 17, 2024
108b7d2
Update Rules
zlabkeeb Mar 17, 2024
b1d2755
Update
zlabkeeb Mar 17, 2024
c3b9ffc
Merge branch 'master' into master
zlabkeeb Mar 20, 2024
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
41 changes: 41 additions & 0 deletions keyboards/zlabkeeb/6pad/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"manufacturer": "zlabkeeb",
"maintainer": "zlabkeeb",
"development_board": "promicro",
"features": {
"bootmagic": true,
"extrakey": true,
"encoder": true,
"mousekey": true,
},
"build": {
"lto": true
},
"url": "https://github.com/zlabkeeb",
"usb": {
"vid": "0x4154"
},
"encoder": {
"rotary": [
{"pin_a": "B4", "pin_b": "B5"}
]
},
"matrix_pins": {
"direct": [
["D1", "D0", "D4"],
["C6", "D7", "E6"]
]
},
"layouts": {
"LAYOUT": {
"layout": [
{"x": 0, "y": 0, "matrix": [0, 0]},
{"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]}
]
}
}
}
49 changes: 49 additions & 0 deletions keyboards/zlabkeeb/6pad/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
Copyright 2024 zlabkeeb ([email protected])

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* ┌─────────┌─────────┌─────────┐
* │ 1 │ layer 1 │ 3 │
* ├─────────┼─────────┼─────────|
* │ 4 │ 5 │ 6 |
* ├─────────┼─────────┼─────────┘
*/
[0] = LAYOUT(
KC_1, TO(1), KC_2,
KC_3, KC_4, KC_5
),
/*
* ┌─────────┌─────────┌─────────┐
* │ A │ layer O │ B │
* ├─────────┼─────────┼─────────|
* │ C │ D │ E |
* ├─────────┼─────────┼─────────┘
*/
[1] = LAYOUT(
KC_A, TO(0), KC_B,
KC_C, KC_D, KC_E
)
};
zlabkeeb marked this conversation as resolved.
Show resolved Hide resolved
#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(KC_PGDN, KC_PGUP)}
};
#endif
1 change: 1 addition & 0 deletions keyboards/zlabkeeb/6pad/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes
80 changes: 80 additions & 0 deletions keyboards/zlabkeeb/6pad/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
Copyright 2024 zlabkeeb ([email protected])

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H


uint16_t underglow_timer = 0;
bool underglow_on = true;
uint8_t prev_rgb_mode; // variable to store the previous RGB mode

layer_state_t layer_state_set_user(layer_state_t state) {
prev_rgb_mode = rgblight_get_mode(); // store the current RGB mode before changing it
zlabkeeb marked this conversation as resolved.
Show resolved Hide resolved
switch (get_highest_layer(state)) {
case 0:
rgblight_setrgb (0x00, 0x00, 0xFF); // LED blue for layer 0
underglow_timer = timer_read();
underglow_on = false;
break;
case 1:
rgblight_setrgb (0xFF, 0x00, 0x00); // LED red for layer 1
underglow_timer = timer_read();
underglow_on = false;
break;
case 2:
rgblight_setrgb (0xFF, 0xFF, 0x00); // LED yellow for layer 2
underglow_timer = timer_read();
underglow_on = false;
break;
case 3:
rgblight_setrgb (0x00, 0xFF, 0x00); // LED green for layer 3
underglow_timer = timer_read();
underglow_on = false;
break;
default: // for any other layers, or the default layer
rgblight_setrgb (0x00, 0x00, 0x00);
underglow_timer = timer_read();
underglow_on = false;
break;
}
return state;
}

void matrix_scan_user(void) {
if (!underglow_on && timer_elapsed(underglow_timer) > 3000) { // 3000ms = 3 seconds
rgblight_mode_noeeprom(prev_rgb_mode); // restore the previous RGB mode
underglow_on = true;
}
}
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* ┌─────────┌─────────┌─────────┐
* │ 1 │ 2 │ 3 │
* ├─────────┼─────────┼─────────|
* │ 4 │ 5 │ 6 |
* ├─────────┼─────────┼─────────┘
*/
[0] = LAYOUT(
KC_1, KC_2, KC_3,
KC_4, KC_5, KC_6
)
};
zlabkeeb marked this conversation as resolved.
Show resolved Hide resolved
#if defined (ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}
};
#endif
2 changes: 2 additions & 0 deletions keyboards/zlabkeeb/6pad/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes
27 changes: 27 additions & 0 deletions keyboards/zlabkeeb/6pad/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 6PAD

![6PAD](https://i.imgur.com/Ugc3R2Th.jpg)

6PAD is a Simple Yet Elegant Macropad, 5 Keys & Single Rotary Encoder, Designed And Manufactured In INDONESIA.

- Rev. 1 Support RGB light UnderGlow
- Rev. 2 [SOON!!]Support RGB light UnderGlow & RGB Matrix
- Keyboard Maintainer: [zlabkeeb](https://github.com/zlabkeeb)
- Hardware Supported: 6Pad PCB rev1, Promicro
- Hardware Availability: SOON!! TOKOPEDIA

Make example for this keyboard (after setting up your build environment):

make zlabkeeb/6pad/rev1:default

Flashing example for this keyboard:

make zlabkeeb/6pad/rev1: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 1 way:

- **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
31 changes: 31 additions & 0 deletions keyboards/zlabkeeb/6pad/rev1/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"keyboard_name": "ZLABKEEB 6PAD",
"features": {
"rgblight": true
},
"usb": {
"device_version": "1.0.0",
"pid": "0x7A77"
},
"rgblight": {
"animations": {
"alternating": true,
"breathing": true,
"christmas": true,
"knight": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"rgb_test": true,
zlabkeeb marked this conversation as resolved.
Show resolved Hide resolved
"snake": true,
"static_gradient": true,
"twinkle": true
},
"led_count": 12,
"max_brightness": 180,
"saturation_steps": 8,
"sleep": true
},
"ws2812": {
"pin": "B6"
}
}
1 change: 1 addition & 0 deletions keyboards/zlabkeeb/6pad/rev1/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file intentionally left blank
1 change: 1 addition & 0 deletions keyboards/zlabkeeb/6pad/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file intentionally left blank
zlabkeeb marked this conversation as resolved.
Show resolved Hide resolved
Loading