Skip to content

Commit f5f1a0b

Browse files
authored
Merge pull request #597 from Bluelightning26/main
Blupad
2 parents 4931656 + 87d4d16 commit f5f1a0b

File tree

9 files changed

+142557
-0
lines changed

9 files changed

+142557
-0
lines changed
132 KB
Binary file not shown.

hackpads/BluPad/CAD/BluPad Top.stl

58.7 KB
Binary file not shown.

hackpads/BluPad/Firmware/code.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# You import all the IOs of your board
2+
import board
3+
4+
# These are imports from the kmk library
5+
from kmk.kmk_keyboard import KMKKeyboard
6+
from kmk.scanners.keypad import KeysScanner
7+
from kmk.keys import KC
8+
from kmk.modules.macros import Press, Release, Tap, Macros
9+
10+
# This is the main instance of your keyboard
11+
keyboard = KMKKeyboard()
12+
13+
# Add the macro extension
14+
macros = Macros()
15+
keyboard.modules.append(macros)
16+
17+
# Define your pins here!
18+
keyboard.pins_col = [board.GPIO2, board.GPIO4, board.GPIO03]
19+
keyboard.pins_row = [board.GPIO6, board.GPIO7, board.GPIO0]
20+
21+
# Tell kmk we are not using a key matrix
22+
keyboard.matrix = KeysScanner(
23+
keyboard=PINS,
24+
value_when_pressed=False,
25+
)
26+
27+
# Here you define the buttons corresponding to the pins
28+
# Look here for keycodes: https://github.com/KMKfw/kmk_firmware/blob/main/docs/en/keycodes.md
29+
# And here for macros: https://github.com/KMKfw/kmk_firmware/blob/main/docs/en/macros.md
30+
keyboard.keymap = [
31+
KC.1,
32+
KC.2,
33+
KC.3,
34+
KC.4,
35+
KC.5,
36+
KC.6,
37+
KC.7,
38+
KC.8,
39+
KC.SPACE,
40+
KC.0,
41+
MEDIA.MUTE
42+
]
43+
44+
# Start kmk!
45+
if __name__ == '__main__':
46+
keyboard.go()

0 commit comments

Comments
 (0)