Because you might want to get keyboard/mouse/gamepad/HID input into your CircuitPython projects without having to think much about USB.
- Copy the
adafruit_hid
CircuitPython library bundle into thelib
directory on your CircuitPython device. - Copy the ch559.py file into the
lib
directory on your CircuitPython device. - Hook up the CH559's Tx and Rx pins to your desired UART pins on the CircuitPython device. (In the example image below, I am using pins D6 (TX) and D7 (RX) on a Seeeduino XIAO). Also, make sure your CH995 is powered - this will depend on the breakout board you're using.
- See code.py for usage. tl;dr:
- Create a UART instance.
- Create an instance of
Ch559
, passing the UART in as a dependency. - repeatedly call
ch559.poll()
to get the latest events.
Example connection using a Seeeduino XIAO and a CH559 breakout from MatzElectronics on Tindie.