Code for arduino nano v3 for a usb gamepad, help please

Hi, a few days ago a friend of mine gave me a "rock candy xbox one" controller. He broke a joystick and he bought a new controller so he gave it to me as I often repair things. I desoldered the joystick and in a few days I will solder the new one.

The problem is that I'm using windows 7 and it looks like it only works with windows 10. And I don't want to update :')

So I thought that I could find the button contacts on the pcb, which I did, and then hook them to an arduino and make it work with my pc.

The thing is that I want to integrate the arduino board inside the controller so I need something small and that is capable of supporting 15 buttons, 2 joysticks, and 2 triggers. The triggers are not switches but potentiometers so at least I need 6 analog inputs, and 15 digital inputs. Arduino Nano v3 has 13 digital inputs and 8 analog inputs. So if I use 2 analog inputs as digital inputs I shouldn't have any problem.

The problem is that I can't find any code that has been already built by someone and I don't have any idea on how to write anything :cry:

All the codes I find are not for this version of arduino because people say that it doesn't have usb support. But v3 does have usb support so I'm a little bit confused.

I don't know how to program but if someone can help me a little bit I could maybe get it to work. Maybe there is some code that my brother, who knows some C code can edit to adapt it to my controller. If anyone knows about some code I would highly appreciate a comment here, because I also want to do this thing with a chinese wii u pro controller that only works through bluetooth and it doesn't work by any means with windows (although it does on linux so I know it isn't broken).

I hope someone can help me here... I don't know where to ask, I'm a bit lost

What makes you think that controller only works with Windows 10? Xbox controllers work on Windows 7 too.

azigta:
All the codes I find are not for this version of arduino because people say that it doesn't have usb support. But v3 does have usb support so I'm a little bit confused.

The Nano v3 does have a USB port that can be used to program the board or to communicate via serial, but it does not have a USB host controller so it can't act as any type of HID. For that you'd want the pro-micro. To do this with a nano you'd have to write a second program on the PC that communicates with the Arduino over the serial line. The arduino simply reads the buttons and puts together a string that represents what state everything is in and sends it to the PC. THe program on the PC reads that string and figures out the states of all the buttons and then fires whatever event triggers or whatever you want fired.

Pro-Micro, a regular Micro or a Teensy 3.x will work nicely. The Teensy has better library support for this kind of stuff and it's slightly smaller, which may or may not be important for you.

Hi, a few days ago, A friend of mine gave me a "rock candy xbox one" controller that was broken and I managed to repair it, but it turns out it doesn't work with windows 7. So I thought that I could wire up all the buttons, triggers and joysticks, and then connect them to an arduino and use it as a gamepad.

It turns out that this has been done with ps2 controllers but the problem is that ps2 controller triggers aren't like the xbox 360 ones. The ps2 controller triggers are simple switches and the xbox 360 ones are potentiometers.

I saw this post on instructables and the libraries on github

But I don't understand it because I don't know how to program. My controller has 15 buttons, 2 joysticks and 2 triggers with potentiometers. Also a led that turns on when you connect it to the pc and some rumbles that I wouldn't care if they don't work. Could someone adapt the code for me so I can make the controller work with windows 7?

I also want to do this with a wii u pro controller but without the code I have nothing to do :cry: I'm studying how to program since yesterday and I hope someday I'll be able to do this kind of things but for the moment I have no idea and I would highly appreciate it if someone could write the code for me if it isn't much of a trouble. I don't know if this takes minutes, hours or days, because I have no idea about programming stuff.

If it's easy and someone here can help me I would really appreciate it. I would use a chinese arduino because I don't have much money. It would be a "Micro ATmega32U4 (5 V, 16 MHz)"

Thanks

azigta:
........But I don't understand it because I don't know how to program...........Could someone adapt the code for me so I can make the controller work with windows 7?........ and I would highly appreciate it if someone could write the code for me if it isn't much of a trouble.

This section of the forums is for guidance on a project that you're writing the code for yourself.

If you want someone to write the code for you, the correct section is "Gigs and Collaborations". Be aware that you'll probably have to offer to pay someone to write the code for you. This is not a small project, I should add.

Perhaps you could ask a moderator to move this thread to the appropriate section. (You can click on "Report to moderator, and ask in the provided text box.)

OldSteve:
This section of the forums is for guidance on a project that you're writing the code for yourself.

If you want someone to write the code for you, the correct section is "Gigs and Collaborations". Be aware that you'll probably have to offer to pay someone to write the code for you. This is not a small project, I should add.

Perhaps you could ask a moderator to move this thread to the appropriate section. (You can click on "Report to moderator, and ask in the provided text box.)

I can't afford to pay someone to write it for me, I better delete the post and spend time learning how to program T.T anyway thanks

This is cross posted here: http://forum.arduino.cc/index.php?topic=415160.msg2859118#msg2859118 although the original post seems to have been vandalized.

Xbox controllers work just fine on Windows 7. They even work on Vista. I'd bet they work on XP even, but I haven't tried that one.

What makes you think it doesn't work on Windows 7?

azigta:
I can't afford to pay someone to write it for me, I better delete the post and spend time learning how to program T.T anyway thanks

Don't delete your opening post or do what you did in the other one, (remove the original question). Once there are replies, it's too late to do either of those things, or the replies lose all meaning.

Learning how to write the code yourself is a good idea. Certainly better than asking others to do it for you.

Just put your (fairly complex) project aside for the moment, and start working through the basic examples provided with the IDE. Once you're comfortable with the basics, including 'millis()'-based timing instead of using 'delay()', then return to your original project idea.

Threads merged. Original post restored.

@azigta, do not vandalize the forum again.