I would like to create a game controller for Windows. In fact, I have already done this, and my game controller sends a JSON via serial communication. This data contains values for 10 axes that I want to use for a computer game. The hardware and microcontroller part are all done, but I don't know how to make Windows recognize my game controller so that I can use it in games.
JSON example data:
{"axis":[12,145,134,1023,...,0]}
I don't want to use a direct USB connection because in that case, I would have to use microcontrollers that have this capability, and default libraries also have limitations.
your setup - your rules. you need no JSON, just send 10 integers(but Hex will make messages shorter) separated comma with '\n' ending.
then Python script can readUntil('\n') and split on commas to an array.
then you must somehow send values to game. or this game can deserialize by itself?
The thing about using one of the many USB-chip Arduinos is that they put the connection into HID mode rather than CDC and use the driver your PC supports.
Arduino software is Open. It may be easier extending that than writing a driver for the PC.
@GoForSmoke @kolaha
AVR microcontrollers with this feature (BUILT IN USB) are expensive and rare in my country, on the other hand, I have heard that this feature has limitations that limit me from 10-axis support.
In my country, there are various chips such as avr stm32 esp series available. However, avr chips with usb connectivity are very expensive, but I can use STM32F103C8T6 which is almost reasonable price, I'm not sure about esp32, does it have usb connectivity?
I'm sorry but Adafruit sell USB-AVR boards for $10 ea. Whoever fabs those boards is not paying expensive for those chips.
What is expensive is board size. How many on a sheet is why I bought modules instead of $hields.
What you can get from HK, not the same since Xi. Sorry, also the pandemic shipping disasters and piracy of deliveries need to clear before business can turn around like before. I saw what the PC clones did to the price of not just computers but the advances that sales drove. I know how it works, economies have inertia.
It's good, maybe I can say it's great, but I would have liked to write the program myself, well, naturally, when I write it myself, I'm familiar with all the limitations, and I can consider, for example, 10, 12, or maybe more axes instead of 8.