kmk_firmware/boards/anavi/knobs1/code.py
Leon Anavi 55df583396 anavi/knobs3: Add ANAVI Knob 1
Add support for ANAVI Knob 1: an open source programmable mini
mechanical keyboard with a rotary encoders and Seeed XIAO RP2040.
This is open source hardware designed with KiCad, the smaller
version of ANAVI Knobs 3.

Signed-off-by: Leon Anavi <leon@anavi.org>
2022-05-30 13:11:07 -07:00

29 lines
632 B
Python

import board
from anaviknob import AnaviKnob
from kmk.extensions.RGB import RGB, AnimationModes
from kmk.keys import KC
from kmk.modules.encoder import EncoderHandler
encoder_handler = EncoderHandler()
encoder_handler.pins = ((board.D1, board.D2, None, False),)
encoder_handler.map = (((KC.VOLD, KC.VOLU),),) # base layer
knob = AnaviKnob()
knob.modules.append(encoder_handler)
rgb_ext = RGB(
pixel_pin=board.NEOPIXEL,
num_pixels=1,
val_limit=100,
val_default=25,
animation_mode=AnimationModes.RAINBOW,
)
knob.extensions.append(rgb_ext)
knob.keymap = [[KC.MUTE]]
if __name__ == '__main__':
knob.go()