Showing results for 
Search instead for 
Did you mean: 

How to use STM32F103C8T6 as a joystick gamepad using Custom USB HID


Hi, i want to connect two joysticks and some push buttons to my STM32F103C8T6 and make something like a Playstation controller, using USB HID to make my PC recognise it as a JOYSTICK Gamepad and then i can like play fifa with it or something.

I saw a lot of tutorials on how to make STM32  act as a USB HID device but it all was about Keyboard or a Mouse and i want to know what to edit exactly in their code to make a joystick Gamepad interfacing.

How to connect the two joysticks and push buttons is a relatively easy jop to do and there's alot of tutorials about it on YouTube, my main concern is How to interfcase it as a JOYSTICK Gamepad.

any one who can send me a video link or some Step-by-Step tutorial on how to do it will be greatly helping me


ST Employee

Dear @moazabdeljalil ,

It is all a matter of HID usage tables mapping to your hardware in this case a Joystick instead of a mouse or keyboard . We do not have a ready to go example however it should not be complex if following the USB specs here and tuning our mouse or HID example  :

Hope it helps you ,