feat: CH552 based firmware
This commit is contained in:
BIN
RP2040/lib/adafruit_debouncer.mpy
Normal file
BIN
RP2040/lib/adafruit_debouncer.mpy
Normal file
Binary file not shown.
BIN
RP2040/lib/adafruit_hid/__init__.mpy
Normal file
BIN
RP2040/lib/adafruit_hid/__init__.mpy
Normal file
Binary file not shown.
BIN
RP2040/lib/adafruit_hid/consumer_control.mpy
Normal file
BIN
RP2040/lib/adafruit_hid/consumer_control.mpy
Normal file
Binary file not shown.
BIN
RP2040/lib/adafruit_hid/consumer_control_code.mpy
Normal file
BIN
RP2040/lib/adafruit_hid/consumer_control_code.mpy
Normal file
Binary file not shown.
BIN
RP2040/lib/adafruit_hid/keyboard.mpy
Normal file
BIN
RP2040/lib/adafruit_hid/keyboard.mpy
Normal file
Binary file not shown.
BIN
RP2040/lib/adafruit_hid/keyboard_layout_base.mpy
Normal file
BIN
RP2040/lib/adafruit_hid/keyboard_layout_base.mpy
Normal file
Binary file not shown.
BIN
RP2040/lib/adafruit_hid/keyboard_layout_us.mpy
Normal file
BIN
RP2040/lib/adafruit_hid/keyboard_layout_us.mpy
Normal file
Binary file not shown.
BIN
RP2040/lib/adafruit_hid/keycode.mpy
Normal file
BIN
RP2040/lib/adafruit_hid/keycode.mpy
Normal file
Binary file not shown.
BIN
RP2040/lib/adafruit_hid/mouse.mpy
Normal file
BIN
RP2040/lib/adafruit_hid/mouse.mpy
Normal file
Binary file not shown.
BIN
RP2040/lib/adafruit_ticks.mpy
Normal file
BIN
RP2040/lib/adafruit_ticks.mpy
Normal file
Binary file not shown.
43
RP2040/main.py
Normal file
43
RP2040/main.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from adafruit_hid.keycode import Keycode
|
||||
from adafruit_hid.keyboard import Keyboard
|
||||
from adafruit_debouncer import Debouncer
|
||||
import usb_hid
|
||||
import digitalio
|
||||
import board
|
||||
|
||||
############# WIRING #############
|
||||
#
|
||||
# GND <-> Audio Jack Ground
|
||||
# GP1 <-> Audio Jack Left/Right
|
||||
#
|
||||
########### END WIRING ###########
|
||||
|
||||
|
||||
############# CONFIG #############
|
||||
keycodePress = Keycode.D
|
||||
readPin = board.GP5
|
||||
|
||||
########### END CONFIG ###########
|
||||
|
||||
|
||||
######## SYSTEM VARIABLES ########
|
||||
# Keyboard
|
||||
kbd = Keyboard(usb_hid.devices)
|
||||
|
||||
# Button/Switch
|
||||
pin = digitalio.DigitalInOut(readPin)
|
||||
pin.direction = digitalio.Direction.INPUT
|
||||
pin.pull = digitalio.Pull.UP
|
||||
switch = Debouncer(pin, interval=0.02)
|
||||
###### END SYSTEM VARIABLES ######
|
||||
|
||||
### BEGIN PROGRAM ###
|
||||
# Clean up any left over keypresses, sometimes they happen
|
||||
kbd.release_all()
|
||||
|
||||
while True:
|
||||
switch.update()
|
||||
if switch.rose:
|
||||
kbd.release(keycodePress)
|
||||
if switch.fell:
|
||||
kbd.press(keycodePress)
|
||||
Reference in New Issue
Block a user