Skip to content

Commit 28c2fa3

Browse files
committed
Merge branch 'main' of https://github.com/hackclub/hackpad
2 parents 42556f6 + ff9d9c1 commit 28c2fa3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+351168
-109
lines changed

hackpads/Duccs Fidget Toy/CAD/Duccpad v3.step

Lines changed: 149964 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import board
2+
3+
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
4+
from kmk.scanners import DiodeOrientation
5+
6+
7+
class KMKKeyboard(_KMKKeyboard):
8+
keyboard.col_pins = (board.GP5, board.GP6)
9+
keyboard.row_pins = (board.GP7, board.GP8)
10+
11+
keyboard.diode_orientation = DiodeOrientation.COL2ROW
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import board
2+
import digitalio
3+
from kmk import KMKKeyboard
4+
from kmk.keys import KC
5+
from kmk.modules import Layer
6+
7+
8+
keyboard = KMKKeyboard()
9+
10+
11+
switch1 = digitalio.DigitalInOut(board.D5)
12+
switch1.switch_to_input(pull=digitalio.Pull.UP)
13+
14+
switch2 = digitalio.DigitalInOut(board.D6)
15+
switch2.switch_to_input(pull=digitalio.Pull.UP)
16+
17+
switch3 = digitalio.DigitalInOut(board.D7)
18+
switch3.switch_to_input(pull=digitalio.Pull.UP)
19+
20+
switch4 = digitalio.DigitalInOut(board.D8)
21+
switch4.switch_to_input(pull=digitalio.Pull.UP)
22+
23+
24+
keyboard.pins = {
25+
board.D5: KC.A, # Switch 1 mapped to KC.A
26+
board.D6: KC.B, # Switch 2 mapped to KC.B
27+
board.D7: KC.C, # Switch 3 mapped to KC.C
28+
board.D8: KC.D, # Switch 4 mapped to KC.D
29+
}
30+
31+
32+
layer1 = Layer([KC.LSFT, KC.LCTL, KC.LALT])
33+
34+
35+
keyboard.modules.append(layer1)
36+
37+
38+
if __name__ == "__main__":
39+
while True:
40+
keyboard.poll()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Firmware runs on KMK!

0 commit comments

Comments
 (0)