Skip to content

Commit ee2e90a

Browse files
committed
bi gupdate
1 parent 1b0cfc2 commit ee2e90a

File tree

13 files changed

+158819
-179128
lines changed

13 files changed

+158819
-179128
lines changed

hackpads/bfpad/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ i want to leave the PCB exposed, so i made a stand that can be attached to the P
1212

1313
the 8 keys (and secret 9th rotary encoder key) are addressed via a 3x3 key matrix, using only 6 pins of the RP2040.
1414
![schematic](assets/schematic.png)
15-
this pcb was incredibly annoying to route the first time around. i rerouted it after reading some pcb tips and it turned out... better. i think.
15+
this is the third iteration of the PCB.
1616
![pcb](assets/pcb.png)
1717

1818
## BOM

hackpads/bfpad/assets/bfpad.png

227 KB
Loading

hackpads/bfpad/assets/pcb.png

-25.9 KB
Loading
-2.65 KB
Loading

hackpads/bfpad/cad/hackpad_full.step

Lines changed: 115685 additions & 131643 deletions
Large diffs are not rendered by default.
Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,38 @@
1-
# You import all the IOs of your board
21
import board
3-
4-
# These are imports from the kmk library
2+
import busio
53
from kmk.kmk_keyboard import KMKKeyboard
64
from kmk.scanners import DiodeOrientation
75
from kmk.keys import KC
8-
from kmk.modules.macros import Press, Release, Tap, Macros
6+
from kmk.modules.encoder import EncoderHandler
7+
from kmk.extensions.display import Display, TextEntry, ImageEntry
8+
from kmk.extensions.display.ssd1306 import SSD1306
9+
from kmk.extensions.RGB import RGB
910

10-
# This is the main instance of your keyboard
1111
keyboard = KMKKeyboard()
1212

13-
# Add the macro extension
14-
macros = Macros()
15-
keyboard.modules.append(macros)
13+
encoder = EncoderHandler()
14+
encoder_handler.pins = ((board.SCK, board.RX, None,),)
15+
encoder_handler.map = [((KC.VOLD, KC.VOLU, KC.NO,),)]
16+
keyboard.modules.append(encoder)
1617

17-
# Define your pins here!
18-
keyboard.col_pins = (board.A0, board.A1, board.A2)
19-
keyboard.row_pins = (board.A3, board.MISO, board.MOSI)
20-
keyboard.diode_orientation = DiodeOrientation.COL2ROW
18+
i2c_bus = busio.I2C(board.SCL, board.SDA)
19+
display_driver = SSD1306(i2c=i2c_bus)
20+
display = Display(display=display_driver)
21+
display.entries = [
22+
ImageEntry(image="pfptiny.bmp", x=0, y=0),
23+
TextEntry(text="bfpad", x=40, y=16, y_anchor="M")
24+
]
25+
keyboard.extensions.append(display)
2126

22-
# Here you define the buttons corresponding to the pins
23-
# Look here for keycodes: https://github.com/KMKfw/kmk_firmware/blob/main/docs/en/keycodes.md
24-
# And here for macros: https://github.com/KMKfw/kmk_firmware/blob/main/docs/en/macros.md
27+
rgb = RGB(pixel_pin = board.TX, num_pixels=11)
28+
keyboard.extensions.append(rgb)
29+
30+
keyboard.col_pins = (board.MOSI, board.A0, board.MISO)
31+
keyboard.row_pins = (board.A3, board.A2, board.A1)
32+
keyboard.diode_orientation = DiodeOrientation.COL2ROW
2533
keyboard.keymap = [
26-
[[KC.RABK, KC.DOT, KC.COMMA], [KC.LABK, KC.PLUS, KC.LBRACKET], [KC.MINUS, KC.NO, KC.RBRACKET]]
34+
[[KC.RABK, KC.DOT, KC.COMMA], [KC.LABK, KC.PLUS, KC.LBRACKET], [KC.MINUS, KC.MUTE, KC.RBRACKET]]
2735
]
2836

29-
# Start kmk!
3037
if __name__ == '__main__':
3138
keyboard.go()
4.13 KB
Binary file not shown.

0 commit comments

Comments
 (0)