Improved version of native USB Joystick, built against SDK version 2.
Intended for anyone with a general interest in USB on a Raspberry Pico, or looking for a working example to adapt for other usage - e.g. MIDI.
All interrupt-driven, no background task required.
A Serial/CDC version is available here
The example provided simulates a continually-running joystick.
Once compiled, the uf2 image can be uploaded as normal and the Pico attached to a host machine.
Debug Probe / Picoprobe or other UART interface device required to view debug messages.
Pico should then enumerate as a Human Interface Device / Joystick game controller and send continuous axis movement and button activity to the host.
Windows Game Controllers
On a Windows machine, type joy.cpl into the search box to display the game controller properties.
The properties windows should update continually at a nominal rate of 1Hz.
Pico pre-built .uf2 binary
Pre-Built .uf2 available here
Testing has been performed with a Windows 10 22H2 Host and a Pico Chip B2, ROM V3 device only.