use usb hid with steam allows mouse and keyboard as well but requires a device (though no modifications needed)
REF
Badger20240 appears to have USB\VID_03F0&PID_0C67
USB\VID_2E8A&PID_0003&MI_00
Pico has Pico C SDK Product ID - not Micro/CircuitPython?!
Mapping of Buttons (according to web gamepadtester) -as B0..B16, i.e
0..3 A B X Y
4..7 LB RB HOME LT - 0..1.0, i.e. analogue button N/A RT - 0..1.0, i.e. analogue button
8..11 Select (left) Start (right) L Stick Press R Stick Press
12..15 ^ v < >
CRASH?! rpico.js won't pass invalid button
DONE
reset presses gamepad button every 2 seconds for 1 second
badger button a/b/c presses gamepad buttons A B X
message from PC is shown on display
OR can blink on/off led - reliably
message passes true/false as value 1/0
handle 1 to press and 0 to release for an identified button
handle either
Create razor based tester with androidNeeds https
Try on separate PC with controller
no longer true for simple use needs chrome insecure setting in chrome://flags
Send button as B to press and b to release
message pass axis val as 0..1
need to map to -32767..32767
convert in rpico.gamepad_axis before sending to server
n.b. map to non 0 so 0+ have 1 added so empty/corrupted can be detected
so rpico needs to map back as well, i.e. 1..65536 maps to -32767..32767
handle val to trigger/stick
Need to be recognised properly by Windows:
axis - send as XYZ and xyz (for rotation)
trigger - see previous - possibly using 1..255 with 128 as middle
Hat -send as button
Can't have any other hid connection at same time - so can't send message over USB For games (and windows) may need to be an XBox 360 controller - see https://github.com/fluffymadness/tinyusb-xinput and GP2040 (CE)?
may be easier as C :(
really only needs to unserialize data sent to it...
Fix:
Tried
For TinyGo see https://github.com/tinygo-org/tinygo/blob/release/src/examples/hid-joystick/main.go
minimal tests/code
TODO:
REF
Badger20240
appears to have USB\VID_03F0&PID_0C67Pico has Pico C SDK Product ID - not Micro/CircuitPython?!
Mapping of Buttons (according to web gamepadtester) -as B0..B16, i.e
0..3 A B X Y 4..7 LB RB HOME
LT - 0..1.0, i.e. analogue buttonN/ART - 0..1.0, i.e. analogue button8..11 Select (left) Start (right) L Stick Press R Stick Press 12..15 ^ v < >DONE
reset presses gamepad button every 2 seconds for 1 secondCreate razor based tester with androidNeeds httpsneeds chrome insecure setting in chrome://flagsHat-send as buttonPlatformIO with https://github.com/fluffymadness/tinyusb-xinput