Skip to content

Commit 57e7736

Browse files
authored
Merge pull request #447 from sunray4/main
Add RayPad*
2 parents 7251d31 + 2fd9f84 commit 57e7736

19 files changed

+116861
-0
lines changed

hackpads/RayPad*/CAD/RayPad v18.step

Lines changed: 109858 additions & 0 deletions
Large diffs are not rendered by default.

hackpads/RayPad*/Firmware/main.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
print("Starting")
2+
3+
# Import all the IOs of the board
4+
import board
5+
print(dir(board)) #check that the pin names are the same as the pins defined below
6+
7+
# Imports from the kmk library
8+
from kmk.kmk_keyboard import KMKKeyboard
9+
from kmk.scanners.keypad import KeysScanner
10+
from kmk.keys import KC
11+
from kmk.extensions.rgb import RGB
12+
from kmk.modules.layers import Layers
13+
# from kmk.modules.macros import Press, Release, Tap, Macros
14+
15+
# Main instance of keyboard
16+
keyboard = KMKKeyboard()
17+
18+
keyboard.modules.append(Layers())
19+
20+
# Add the macro extension
21+
# macros = Macros()
22+
# keyboard.modules.append(macros)
23+
24+
#Define the RGB pin
25+
rgb = RGB(rgb_pixel_pin = board.SDA, num_pixels = 3)
26+
keyboard.extensions.append(rgb)
27+
28+
# Define the pins
29+
PINS = [board.SCK, board.MISO, board.MOSI, board.RX]
30+
31+
# Tell kmk we are not using a key matrix
32+
keyboard.matrix = KeysScanner(
33+
pins=PINS,
34+
value_when_pressed=False,
35+
)
36+
37+
RAISE = KC.LT(1, KC.ESCAPE)
38+
LOWER = KC.LT(0, KC.RGB_TOG)
39+
40+
# Define the buttons corresponding to the pins
41+
# Keycodes: https://github.com/KMKfw/kmk_firmware/blob/main/docs/en/keycodes.md
42+
# Macros: https://github.com/KMKfw/kmk_firmware/blob/main/docs/en/macros.md
43+
keyboard.keymap = [
44+
[#layer 0
45+
KC.PAUSE, KC.DELETE, KC.SPACE, RAISE,
46+
],
47+
[#layer 1
48+
KC.RGB_MODE_BREATHE_RAINBOW, KC.RGB_HUI, KC.RGB_MODE_SWIRL, LOWER,
49+
],
50+
51+
]
52+
53+
# Start kmk!
54+
if __name__ == '__main__':
55+
keyboard.go()

hackpads/RayPad*/PCB/fp-info-cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)