I want to make a custom gamepad using an arduino leonardo and the xbox pad documentation I found (I want to do this because i want my pad to be compatible with games). The problem is, the library I found uses axis such as Throttle, while xbox pads according to the documentation use buttons and axis named by numbers. Can someone recommend me a easy to use library with custom named axis, or would i have to try to write everything from scratch?
I had a similar goal where I need to make a custom joystick using a Micro (and custom inputs).
MHerionmus's library looks pretty awesome to me, although I'm still struggling on the hardware (24 digital input + 6 analog)
The library is good, but I couldnt find any documentation on buttons, and I specified that I want to be able to make custom axis, like axis 1, axis 2, etc. Instead of throttle, rudder, brake, x, y, z etc.
I'm not sure how to do that.
Each axis present in the "USB Gamepad" have a name.
You can hook up a potentiometer to any random axis (such as axis W) and you can change your settings in the game (say change "moving left and right" to use said axis "W").
The best way is to have a existing joystick. Then go to Windows Driver properties to see which button lights up when you press a button (e.g. i think button 7 is right-stick-centerpush)
(Post deleted by author)
By documentation I meant how to write code for them. I know which axis and buttons i want, because I want to have it the same as an xbox 360 pad. (Some games don't allow you to change controls) I mean I could solve half the problem by using steam, but AFAIK I need buttons to change the settings.
On the note of changing things, isn't the library license allowing you to modify it? Imean for personal use, since I think I couldn't post it online.
Also, sorry for not replying sooner, i check the forum once a week because I didn't expect an answer that fast.
I haven't looked at the code yet. My customized PCB is arriving in two days, so I'll be waiting for that to be delivered, then i'll hook up the stuff and check the 24 buttons and 6 potentiometers I had wired up.
My thoughts are that the code is ugly as sin, but the code is there and you can look at it.
If you are not in a hurry
Yes, but I don't like the license on the library (because it's LGPL, which require me to license my work also under that, but I license all my work with GPL 2.0).
I think I will be able to walk away by looking at their code and write my own version that does the same thing, and license it under GPL 2.0.
(briefly look at the code)
Damn. I hate OOP. Also, he used Allman indentation instead of K&R.
This is indeed ugly as sin. But at least the header file look decent
If you don't mind waiting (for three month or so), I can cleaning the mess up and post something that a regular human can understand, modify, and shape it to their needs.
As long as you do it within 4 months, the forum is happy.
Well I dont have to worry about licensing if I dont upload code online, right? I mean changing values tonmake the library work like I want it to.
Ha. They even gave me a badge for "first emoji".
I am not a fan of emojis, but under the right circumstances they do provide the nift.