Skip to content

Commit

Permalink
[Keyboard] Add jkdlab/binary_monkey (#12374)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan <[email protected]>
  • Loading branch information
LDobac and fauxpark authored Apr 19, 2021
1 parent 20f35af commit 3990c0f
Show file tree
Hide file tree
Showing 8 changed files with 248 additions and 0 deletions.
19 changes: 19 additions & 0 deletions keyboards/jkdlab/binary_monkey/binary_monkey.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2021 JKDLAB. <[email protected]>
* Copyright 2021 Jaehee <[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 3 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 https://www.gnu.org/licenses/.
*/

#include "binary_monkey.h"
28 changes: 28 additions & 0 deletions keyboards/jkdlab/binary_monkey/binary_monkey.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2021 JKDLAB. <[email protected]>
* Copyright 2021 Jaehee <[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 3 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 https://www.gnu.org/licenses/.
*/

#pragma once

#include "quantum.h"

#define LAYOUT( \
K00, K01, \
K10 \
) { \
{ K10, K00, K01 } \
}
42 changes: 42 additions & 0 deletions keyboards/jkdlab/binary_monkey/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2021 JKDLAB. <[email protected]>
* Copyright 2021 Jaehee <[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 3 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 https://www.gnu.org/licenses/.
*/

#pragma once

#include "config_common.h"

#define VENDOR_ID 0x4934
#define PRODUCT_ID 0x0101
#define DEVICE_VER 0x0001
#define MANUFACTURER JKDLAB.
#define PRODUCT Binary_Monkey

#define MATRIX_ROWS 1
#define MATRIX_COLS 3
#define MATRIX_ROW_PINS { D0 }
#define MATRIX_COL_PINS { D1, D2, D3 }

#define DIODE_DIRECTION COL2ROW

#define DEBOUNCE 5

#define USB_MAX_POWER_CONSUMPTION 100

/* Bootmagic Lite key configuration */
#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 2
16 changes: 16 additions & 0 deletions keyboards/jkdlab/binary_monkey/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"keyboard_name": "Binary_Monkey",
"url": "https://gumroad.com/jkdlab",
"maintainer": "JKDLAB.",
"width": 3,
"height": 1,
"layouts": {
"LAYOUT": {
"layout": [
{"label": "0", "x": 0, "y": 0},
{"label": "1", "x": 1, "y": 0},
{"label": "ENTER", "x": 0, "y": 1, "w" : 2}
]
}
}
}
70 changes: 70 additions & 0 deletions keyboards/jkdlab/binary_monkey/keymaps/ascii/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright 2021 JKDLAB. <[email protected]>
* Copyright 2021 Jaehee <[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 3 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 https://www.gnu.org/licenses/.
*/

#include QMK_KEYBOARD_H

char ascii = 0;

enum custom_keycodes {
BIN_0 = SAFE_RANGE,
BIN_1,
BIN_RETURN
};

enum layers {
_BASE = 0
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT(
BIN_0, BIN_1,
BIN_RETURN
)
};

bool process_record_user(uint16_t keycode, keyrecord_t* record) {
switch (keycode) {
case BIN_0:
if (record->event.pressed) {
ascii = ascii << 1;
}

return true;
case BIN_1:
if (record->event.pressed) {
ascii = ascii << 1;
++ascii;
}

return true;
case BIN_RETURN:
if (record->event.pressed) {
char str[2] = { ascii & 127, '\0' };

send_string(str);

ascii = 0;
}

return true;
default:
return true;
}

return true;
}
30 changes: 30 additions & 0 deletions keyboards/jkdlab/binary_monkey/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2021 JKDLAB. <[email protected]>
* Copyright 2021 Jaehee <[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 3 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 https://www.gnu.org/licenses/.
*/

#include QMK_KEYBOARD_H

enum layers {
_BASE = 0
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT(
KC_0, KC_1,
KC_ENTER
)
};
21 changes: 21 additions & 0 deletions keyboards/jkdlab/binary_monkey/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Binary_Monkey

![Binary_Monkey](https://i.imgur.com/0meBVKTh.png)

It is 3-Key macropad, inspired by a monkey. 🐵

* Keyboard Maintainer: [JKDLAB.](https://github.com/jkdlab) [yikolden](https://github.com/LDobac)
* Hardware Supported: atmega32u4
* Hardware Availability: [Gumroad](https://gumroad.com/jkdlab)

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

make jkdlab/binary_monkey:default

If you want switch to bootloader, unplug the keyboard and plug it back while pressing right upper key(Key 1).

Flashing example for this keyboard (You need to keyboard has in bootloader mode) :

make jkdlab/binary_monkey: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).
22 changes: 22 additions & 0 deletions keyboards/jkdlab/binary_monkey/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# MCU name
MCU = atmega32u4

# Bootloader selection
BOOTLOADER = atmel-dfu

# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output

0 comments on commit 3990c0f

Please sign in to comment.