This commit is contained in:
jojomawswan 2025-12-01 13:29:04 -07:00
commit aef37123fd
4 changed files with 81 additions and 72 deletions

View file

@ -1,8 +1,8 @@
# example_switch_macro.py
import time
from switch_pico_uart import SwitchUARTClient, SwitchButton, SwitchDpad
from switch_pico_uart import SwitchUARTClient, SwitchButton, SwitchDpad, first_serial_port
PORT = "COM5" # change to your serial port, e.g. /dev/cu.usbserial-0001
PORT = first_serial_port(include_descriptions=["USB to UART"]) or "COM5" # auto-pick first serial port, or fall back
SEND_INTERVAL = 1 / 500 # optional: match controller_uart_bridge default
# Convenience list of every SwitchButton (plus DPAD directions).