Add firmware to production folder

This commit is contained in:
Daniel Benge 2025-02-20 18:06:26 +00:00 committed by GitHub
parent 5389abb26b
commit 42f8274bf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,36 @@
from kmk.kmk_keyboard import KMKKeyboard
from kmk.scanners.digital import MatrixScanner
from kmk.modules.encoder import EncoderHandler
from kmk.modules.rgb import RGB
from kmk.keys import KC
from kmk.handlers.stock import led_toggle
keyboard = KMKKeyboard()
# because I wired them in a matrix
keyboard.matrix = MatrixScanner(columns=[8, 9, 10], rows=[7, 6, 5])
encoder_handler = EncoderHandler()
keyboard.modules.append(encoder_handler)
encoder_handler.pins = ((2, 3, 1),) # (A, B, switch on schematic on kiCad)
encoder_handler.map = [
((KC.VOLD, KC.VOLU),), # I may change what this does in the future
]
rgb = RGB(pixel_pin=4, num_pixels=9)
rgb.enabled = True
rgb.brightness = 128 # out of 255 but I'd rather not blind myself or blow up the LEDs
keyboard.modules.append(rgb)
keyboard.keymap = [
[KC.Q, KC.W, KC.E],
[KC.A, KC.S, KC.D],
[KC.Z, KC.X, KC.C],
]
keyboard.keymap[1][1] = KC.LCTRL(
led_toggle(rgb)
) # when I press ctrl, the LEDs will toggle
if __name__ == "__main__":
keyboard.go()