anavi/macro-pad-10: Add ANAVI Macro Pad 10
Add support for ANAVI Macro Pad 10: an open source programmable small hot-swappable mechanical keyboard with 9 keys, a rotary encoder and Seeed XIAO RP2040. This is open source hardware designed with KiCad. Signed-off-by: Leon Anavi <leon@anavi.org>
This commit is contained in:
parent
6c71538aa9
commit
fbe593eb80
86
boards/anavi/macro-pad-10/code.py
Normal file
86
boards/anavi/macro-pad-10/code.py
Normal file
@ -0,0 +1,86 @@
|
||||
import board
|
||||
|
||||
from kmk.extensions.LED import LED
|
||||
from kmk.extensions.media_keys import MediaKeys
|
||||
from kmk.extensions.RGB import RGB, AnimationModes
|
||||
from kmk.keys import KC
|
||||
from kmk.kmk_keyboard import KMKKeyboard
|
||||
from kmk.modules.encoder import EncoderHandler
|
||||
from kmk.scanners import DiodeOrientation
|
||||
|
||||
print('ANAVI Macro Pad 10')
|
||||
|
||||
keyboard = KMKKeyboard()
|
||||
led_ext = LED(
|
||||
led_pin=[
|
||||
board.D0,
|
||||
],
|
||||
brightness=100,
|
||||
brightness_step=5,
|
||||
brightness_limit=100,
|
||||
breathe_center=1.5,
|
||||
animation_mode=AnimationModes.STATIC,
|
||||
animation_speed=1,
|
||||
user_animation=None,
|
||||
val=100,
|
||||
)
|
||||
keyboard.extensions.append(led_ext)
|
||||
|
||||
# WS2812B LED strips on the back
|
||||
underglow = RGB(
|
||||
pixel_pin=board.D10,
|
||||
num_pixels=4,
|
||||
val_limit=100,
|
||||
val_default=25,
|
||||
animation_mode=AnimationModes.RAINBOW,
|
||||
)
|
||||
keyboard.extensions.append(underglow)
|
||||
|
||||
# Neopixel on XIAO RP2040
|
||||
frontglow = RGB(
|
||||
pixel_pin=board.NEOPIXEL,
|
||||
num_pixels=1,
|
||||
val_limit=100,
|
||||
val_default=25,
|
||||
animation_mode=AnimationModes.RAINBOW,
|
||||
)
|
||||
keyboard.extensions.append(frontglow)
|
||||
|
||||
keyboard.col_pins = (
|
||||
board.D4,
|
||||
board.D5,
|
||||
board.D6,
|
||||
)
|
||||
keyboard.row_pins = (
|
||||
board.D3,
|
||||
board.D2,
|
||||
board.D1,
|
||||
)
|
||||
keyboard.diode_orientation = DiodeOrientation.ROW2COL
|
||||
|
||||
media_keys = MediaKeys()
|
||||
keyboard.extensions.append(media_keys)
|
||||
|
||||
# Matrix 3x3 keymap, 9 keys in total
|
||||
keyboard.keymap = [
|
||||
[
|
||||
KC.N1,
|
||||
KC.N2,
|
||||
KC.N3,
|
||||
KC.N4,
|
||||
KC.N5,
|
||||
KC.N6,
|
||||
KC.N7,
|
||||
KC.N8,
|
||||
KC.N9,
|
||||
]
|
||||
]
|
||||
|
||||
# Rotary encoder that also acts as a key
|
||||
encoder_handler = EncoderHandler()
|
||||
encoder_handler.pins = ((board.D8, board.D7, board.D9),)
|
||||
encoder_handler.map = (((KC.VOLD, KC.VOLU, KC.MUTE),),)
|
||||
keyboard.modules.append(encoder_handler)
|
||||
|
||||
if __name__ == '__main__':
|
||||
keyboard.go()
|
Loading…
Reference in New Issue
Block a user