Home > Arduino, TKJ Electronics, USB > Xbox 360 receiver added to the USB Host Library

Xbox 360 receiver added to the USB Host Library

You asked for it and here it is.
I finally got the time to implement support for Wireless Xbox 360 controllers to the USB Host Library. This is done via a Xbox 360 Wireless receiver that is normally intended for Windows computers.

The source code can be found at github: https://github.com/felis/USB_Host_Shield_2.0/blob/master/XBOXRECV.cpp
There is an example as well: https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Xbox/XBOXRECV/XBOXRECV.ino.

The receiver supports up to four controllers internally, so it was fairly easy to implement it.

Actually I havn’t tested the library with more than one controller, but if somebody out there could confirm if it’s working or not, with more than one controller, I would really appreciate it!
Thanks to Tim, multiple controllers is now confirmed to work!

If you need to use more than four controllers you will need to connect a second receiver via a USB hub which is also supported by the library.
Simply add the following to the start of your Arduino sketch:

USBHub  Hub1(&Usb);
USBHub  Hub2(&Usb);

Note that you might need to add more instances depending on how many chips there is inside your USB hub.

You will also need to create another instance of the XBOXRECV class like so:

USB Usb;
XBOXRECV Xbox1(&Usb);
XBOXRECV Xbox2(&Usb);

For more information regarding the protocol see the following pages: http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/WirelessUsbInfo and https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL.

Categories: Arduino, TKJ Electronics, USB Tags:
  1. Jon
    March 22nd, 2014 at 03:44 | #1

    Thanks so much for your work on this. I’m just getting into the Arduino scene and I’m looking to eventually control an RC car with a wireless Xbox 360 controller. Your example sketch looks like a great place to start. However, I’m having a bit of trouble.

    After soldering the headers onto the usb host shield, inserting the shield onto the Arduino and plugging the Arduino into the computer, the power light on the shield lights up which I assume means that the shield is receiving power. When I connect the wireless receiver into the usb port on the shield the light on the receiver also lights up. So far so good.

    However, when I try to link the controller to the receiver it doesn’t work. I know that there’s not a problem with either of these two as they successfully link when the receiver is connected via a usb port on the computer. Is it possible that the shield hasn’t been soldered correctly? Do all the pins have to be soldered correctly for the power light to light up, or just the relevant pins? Also, both the controller and the receiver are also third-party. In a previous comment you mentioned that the receiver can be unofficial, but what about the controller?

    Thank you very much for any help and I apologise if any of my questions sounded stupid!

  2. March 28th, 2014 at 01:04 | #2

    @Jon
    Have you remembered to solder the ICSP header as well?
    Also please enable debugging: https://github.com/felis/USB_Host_Shield_2.0#enable-debugging, so we can see what is going on.

    The controller can be unofficial as well ;)

    No need to apologize! I’m just happy that people find my code useful!

  3. April 28th, 2014 at 15:39 | #3

    Hi.

    Thank you very much for that great Library!

    I found a little mistake for more than one controller in the setLedOn function. The controller-parameter was missing so the first received the Lamp of all. I fixed it but I don’t know how to publish:

    void XBOXRECV::setLedOn(LEDEnum led, uint8_t controller) {
    if(led == OFF)
    setLedRaw(0, controller);
    else if(led != ALL) // All LEDs can’t be on a the same time
    setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]) + 4, controller);

    Thank you a lot.

    Bye,
    Torsten

  4. April 28th, 2014 at 21:02 | #4
  5. alex
    August 29th, 2014 at 20:59 | #5

    Hey how can I move 2 motors with L1 and L2?

  6. alex
    August 29th, 2014 at 21:07 | #6

    @alex
    i mean L2 and R2

  7. September 9th, 2014 at 00:07 | #7

    @alex
    It depends on how you have your motors setup, but you could do something like this:

    analogWrite(pwmPin1, Xbox.getButtonPress(L2));
    analogWrite(pwmPin2, Xbox.getButtonPress(R2));
  8. Vinnie Marco
    September 30th, 2014 at 20:00 | #8

    I have been using this library for awhile now and it works pretty great. I have a wireless controller hooked up to an electric wheelchair. I have great control of it, until the controller disconnects. Where in the example in the Arduino IDE could I write 4 signals to LOW when the controller is disconnected and to HIGH only when it is connected? I have played around with an LED to demonstrate this, and it works, but when the controller is connected, my HIGH signals are only 0.6 volts. Once I remove the code that writes the 4 lines to LOW upon disconnect, my HIGH lines return to 5volts.

    Can anyone point me in the right direction?

  9. October 1st, 2014 at 01:10 | #9

    @Vinnie Marco
    Can you post your code somewhere like http://pastebin.com/ or https://gist.github.com/?

    To be honest it sounds like a problem with your code and not the library itself.

  10. Vinnie Marco
    October 1st, 2014 at 04:23 | #10

    I have pasted the code in this link. I am interested to find out where my mistake is!

    http://pastebin.com/sXxL8DJF

    @Lauszus

  11. October 2nd, 2014 at 01:01 | #11

    @Vinnie Marco
    I know what is wrong!

    The problem is that you are setting ControllerConnected low if any one of the Xbox.Xbox360Connected is false. You need to make sure that all of them are false before setting ControllerConnected low.

  12. Vinnie Marco
    October 2nd, 2014 at 02:21 | #12

    Thank you! I understand, however, I am having an issue trying to write this out. How should I structure this statement? With the existing else? With an if? Or an else if? What argument shall I test?

    How far off is the following code?

    if (Xbox.Xbox360Connected == false) {
            digitalWrite(enable1, LOW);
            digitalWrite(enable2, LOW);
            digitalWrite(enable3, LOW);    //these lines need to be written to LOW when the controller is not connected
            digitalWrite(enable4, LOW);
           
            digitalWrite(ControllerConnected, LOW);        
    }//end else for when controller is not connected
  13. Vinnie Marco
    October 2nd, 2014 at 03:59 | #13

    Ahhhhhhh, after days of trying everything I could think of, I finally have it working. It only took since my last comment to figure it out! Thanks so much!!!

     if (!(Xbox.Xbox360Connected[0]) || (Xbox.Xbox360Connected[1]) ||(Xbox.Xbox360Connected[2]) || (Xbox.Xbox360Connected[3]) || (Xbox.Xbox360Connected[4]) == false) {
            digitalWrite(enable1, LOW);
            digitalWrite(enable2, LOW);
            digitalWrite(enable3, LOW);    
            digitalWrite(enable4, LOW);
           
            digitalWrite(ControllerConnected, LOW);
           
            analogWrite(PWMPin2, 0);
            analogWrite(PWMPin, 0);
        //left trigger
           
            analogWrite(PWMPin4, 0);
            analogWrite(PWMPin3, 0);
           
    }//end else for when controller is not connected
  14. October 4th, 2014 at 08:44 | #14

    @Vinnie Marco
    No that is not the way to do it.

    Replace the first line with this:

    if (!Xbox.Xbox360Connected[0] && !Xbox.Xbox360Connected[1] && !Xbox.Xbox360Connected[2] && !Xbox.Xbox360Connected[3]) {

    What it does is that it makes sure that ALL of them are false!

  15. March 14th, 2015 at 17:10 | #15

    Help!
    My xbox receiver or any other usb peripheral wont be recognized by the shield. I ran the qc sketch and it hangs at “waiting for device…”

    any thoughts?

  16. March 15th, 2015 at 00:10 | #16

    @Abad Rosa
    Please try to connect an external power supply.

  17. Sam W
    March 17th, 2015 at 23:44 | #17

    Hi,
    I have the SainSmart USB Host Shield connected to my Uno and when I run the XBOXRECV example, the light on the receiver does not turn on and it does not seem to be recognized. It is a genuine MS receiver. I have also tried a “knock-off” receiver to no avail. The program compiles and uploads just fine. When I open the Serial Monitor, it says “Xbox Wireless Receiver Library Started” but then nothing else happens. I cannot sync my controller with the receiver or anything.

    Also, some of the other example sketches included with the library do not compile. I see lots of “‘prog_char’ was not declared in this scope” in the compile errors. Not sure how to fix this.

  18. March 18th, 2015 at 00:23 | #18

    @Sam W
    Please try to connect an external power supply to your Arduino. Also please consider buying the official shield in the future in order to support the developers of the hardware and library.

    Please also enable serial debugging: https://github.com/felis/USB_Host_Shield_2.0#enable-debugging, so I can see what is going on.

    What example are you referring to, please send a link.

  19. Sam W
    March 18th, 2015 at 01:32 | #19

    @Lauszus
    I’m considering buying the official shield since I’ll need another one soon, and I’m sure the QC is a bit better.

    USB debugging is enabled already, but I don’t see any extra output in the Serial Monitor. I’ve also tried an external power source (9V, 2.5A wall wart) which didn’t help.

    Here’s the example code I’m using:
    https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Xbox/XBOXRECV/XBOXRECV.ino

    Other devices seem to work fine when plugged into the USB Host shield, however. I tried a standard USB keyboard and it worked fine using this example:
    https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino

    Here is the output of board_qc when using either of my wireless receivers:
    http://pastebin.com/AH7sjmh4

    It gets stuck at “Waiting for device…”

    When running board_qc on my USB keyboard, everything passes as expected (not suck at “Waiting for device…”).

  20. March 19th, 2015 at 23:35 | #20

    @Sam W
    It sounds like a problem with the wireless receiver. Does it work under Windows?

  21. ArduinoinNE
    March 20th, 2015 at 04:12 | #21

    I’m having the same exact problem as Sam W above… I have the actual Microsoft wireless receiver. The green indicator light comes on when I plug it directly into my computer, but not when I use my SainSmart USB Host Shield. Again, the same as Sam W… the keyboard example noted above works just fine.

    I’m so frustrated…I was really looking forward to using this with my Arduino RC Car I built!

    Please let me know if you can help Sam and I. Thank you!

  22. March 20th, 2015 at 11:43 | #22
  23. ArduinoinNE
    March 21st, 2015 at 04:35 | #23

    Lauszus -- first off, thank you for the quick response and for putting together such an extensive library!

    I ran the sketch mentioned above on my Arduino Uno with my SainSmart USB Host Shield twice and got the following output on the serial monitor:

    ———————————————————————————————————-

    Circuits At Home 2011
    USB Host Shield Quality Control Routine
    Reading REVISION register… Die revision 03
    SPI long test. Transfers 1MB of data. Each dot is 64K……………. SPI long test passed
    GPIO test. Connect GPIN0 to GPOUT7, GPIN1 to GPOUT6, and so on
    Test failed. Value written: 00 Value read: FF
    Press any key to continue…
    GPIO test passed.
    PLL test. 100 chip resets will be performed
    Resetting oscillator

    Reset number 0 Time to stabilize -- 495 cycles

    Reset number 1 Time to stabilize -- 495 cycles

    Reset number 2 Time to stabilize -- 496 cycles

    Reset number 3 Time to stabilize -- 495 cycles

    Reset number 4 Time to stabilize -- 496 cycles

    Reset number 5 Time to stabilize -- 495 cycles

    Reset number 6 Time to stabilize -- 496 cycles

    Reset number 7 Time to stabilize -- 495 cycles

    Reset number 8 Time to stabilize -- 496 cycles

    Reset number 9 Time to stabilize -- 496 cycles

    Reset number 10 Time to stabilize -- 496 cycles

    Reset number 11 Time to stabilize -- 495 cycles

    Reset number 12 Time to stabilize -- 495 cycles

    Reset number 13 Time to stabilize -- 494 cycles

    Reset number 14 Time to stabilize -- 495 cycles

    Reset number 15 Time to stabilize -- 494 cycles

    Reset number 16 Time to stabilize -- 494 cycles

    Reset number 17 Time to stabilize -- 495 cycles

    Reset number 18 Time to stabilize -- 494 cycles

    Reset number 19 Time to stabilize -- 494 cycles

    Reset number 20 Time to stabilize -- 494 cycles

    Reset number 21 Time to stabilize -- 494 cycles

    Reset number 22 Time to stabilize -- 496 cycles

    Reset number 23 Time to stabilize -- 495 cycles

    Reset number 24 Time to stabilize -- 496 cycles

    Reset number 25 Time to stabilize -- 496 cycles

    Reset number 26 Time to stabilize -- 496 cycles

    Reset number 27 Time to stabilize -- 494 cycles

    Reset number 28 Time to stabilize -- 494 cycles

    Reset number 29 Time to stabilize -- 494 cycles

    Reset number 30 Time to stabilize -- 494 cycles

    Reset number 31 Time to stabilize -- 494 cycles

    Reset number 32 Time to stabilize -- 495 cycles

    Reset number 33 Time to stabilize -- 494 cycles

    Reset number 34 Time to stabilize -- 494 cycles

    Reset number 35 Time to stabilize -- 494 cycles

    Reset number 36 Time to stabilize -- 495 cycles

    Reset number 37 Time to stabilize -- 495 cycles

    Reset number 38 Time to stabilize -- 495 cycles

    Reset number 39 Time to stabilize -- 495 cycles

    Reset number 40 Time to stabilize -- 495 cycles

    Reset number 41 Time to stabilize -- 495 cycles

    Reset number 42 Time to stabilize -- 494 cycles

    Reset number 43 Time to stabilize -- 494 cycles

    Reset number 44 Time to stabilize -- 495 cycles

    Reset number 45 Time to stabilize -- 494 cycles

    Reset number 46 Time to stabilize -- 494 cycles

    Reset number 47 Time to stabilize -- 494 cycles

    Reset number 48 Time to stabilize -- 494 cycles

    Reset number 49 Time to stabilize -- 494 cycles

    Reset number 50 Time to stabilize -- 494 cycles

    Reset number 51 Time to stabilize -- 495 cycles

    Reset number 52 Time to stabilize -- 495 cycles

    Reset number 53 Time to stabilize -- 496 cycles

    Reset number 54 Time to stabilize -- 496 cycles

    Reset number 55 Time to stabilize -- 495 cycles

    Reset number 56 Time to stabilize -- 494 cycles

    Reset number 57 Time to stabilize -- 494 cycles

    Reset number 58 Time to stabilize -- 494 cycles

    Reset number 59 Time to stabilize -- 494 cycles

    Reset number 60 Time to stabilize -- 494 cycles

    Reset number 61 Time to stabilize -- 494 cycles

    Reset number 62 Time to stabilize -- 494 cycles

    Reset number 63 Time to stabilize -- 494 cycles

    Reset number 64 Time to stabilize -- 495 cycles

    Reset number 65 Time to stabilize -- 494 cycles

    Reset number 66 Time to stabilize -- 495 cycles

    Reset number 67 Time to stabilize -- 496 cycles

    Reset number 68 Time to stabilize -- 496 cycles

    Reset number 69 Time to stabilize -- 496 cycles

    Reset number 70 Time to stabilize -- 495 cycles

    Reset number 71 Time to stabilize -- 494 cycles

    Reset number 72 Time to stabilize -- 494 cycles

    Reset number 73 Time to stabilize -- 494 cycles

    Reset number 74 Time to stabilize -- 494 cycles

    Reset number 75 Time to stabilize -- 494 cycles

    Reset number 76 Time to stabilize -- 494 cycles

    Reset number 77 Time to stabilize -- 494 cycles

    Reset number 78 Time to stabilize -- 494 cycles

    Reset number 79 Time to stabilize -- 494 cycles

    Reset number 80 Time to stabilize -- 494 cycles

    Reset number 81 Time to stabilize -- 496 cycles

    Reset number 82 Time to stabilize -- 495 cycles

    Reset number 83 Time to stabilize -- 495 cycles

    Reset number 84 Time to stabilize -- 495 cycles

    Reset number 85 Time to stabilize -- 495 cycles

    Reset number 86 Time to stabilize -- 495 cycles

    Reset number 87 Time to stabilize -- 495 cycles

    Reset number 88 Time to stabilize -- 494 cycles

    Reset number 89 Time to stabilize -- 494 cycles

    Reset number 90 Time to stabilize -- 494 cycles

    Reset number 91 Time to stabilize -- 495 cycles

    Reset number 92 Time to stabilize -- 494 cycles

    Reset number 93 Time to stabilize -- 494 cycles

    Reset number 94 Time to stabilize -- 494 cycles

    Reset number 95 Time to stabilize -- 494 cycles

    Reset number 96 Time to stabilize -- 495 cycles

    Reset number 97 Time to stabilize -- 495 cycles

    Reset number 98 Time to stabilize -- 495 cycles

    Reset number 99 Time to stabilize -- 496 cycles

    Checking USB device communication.

    Waiting for device…

  24. ArduinoinNE
    March 21st, 2015 at 05:29 | #24

    Lauszus, one other quick note… I just tested the inside of USB connection on the USB Host Shield and it was at 3.3 volts. I tried to give the USB port on the USB host shield 5 volts by using a jumper wire from a known 5 volt location on the shield to the power pin of the USB port. However, that still did not cause the wireless receiver indicator light to turn on.

    I realize this is probably not the best test. Do you think I need to cut the 3.3 volt trace to the USB port power and jump the wire from 5 volts to the power pin of the USB port?

  25. March 21st, 2015 at 12:29 | #25

    @ArduinoinNE
    Ahh that must be why it is not working. Yes please reconfigure the VBUS jumper, so the 5V jumper is closed and 3.3V is open. Please see: https://www.circuitsathome.com/wp/wp-content/uploads/2011/02/uhs20s_pin_layout.jpg. It should be the same on your shield.

  26. ArduinoinNE
    March 23rd, 2015 at 04:50 | #26

    Lauszus, before I alter my USB Host Shield… I have a couple of questions first. Here’s a little background first.

    So, I tried connecting the Wireless Xbox Receiver via a USB wire that I modified. I basically just gave the Wireless Xbox Receiver 5 volts and ground (the red and black wires). The Wireless Xbox Receiver did turn on, but would not connect to my Xbox controller, even though it will connect when plugged directly into my PC. I verified the voltage was correct with my multi-meter.

    I also tried manually jumping 5 volts to the VBUS on my USB Host Shield. I uploaded the “XBOXRECV” example sketch, and the Wireless Xbox Receiver did actually turn on. I verified the voltage was correct (around 4.9 volts) with my multi-meter.

    However, in both situations above, I was NOT able to connect my Xbox360 controller to the Wireless Xbox Receiver. Before I cut the 3.3 volt trace to the VBUS, I thought I would verify that I need to actually cut the 3.3 volt trace to the VBUS.

    This leads me to my 2 main questions:
    1. Does having both the 5 volt and 3.3 volt power connected to the VBUS, cause the Wireless Xbox Receiver NOT to connect?
    2. Does the Wireless Xbox Receiver need to receive some sort of signal in order to connect to the Xbox 360 controller?

    Thank you for your help!

  27. March 23rd, 2015 at 12:04 | #27

    @ArduinoinNE
    When you did that test. Did you remember to have a common ground?

    So what you are saying is that you can’t get it working with your PC, either?

    You differently need to cut the 3.3V jumper. You can not connect both of them to 5V or you will potentially fry both the shield and your Arduino.

    You should run the example: https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Xbox/XBOXRECV/XBOXRECV.ino with debugging enabled and the following line uncommented: https://github.com/felis/USB_Host_Shield_2.0/blob/master/XBOXRECV.cpp#L22. If it does not even detect that you plug in the receiver to the shield, then I would say to try a different shield, as it is clearly buggy.

  28. ArduinoinNE
    March 24th, 2015 at 03:53 | #28

    Lauszus, sorry for the confusion.

    Yes, the Wireless Xbox Receiver does work properly when connected directly to the USB port on my PC. My Xbox 360 controller connects without any issues.

    Thanks for the clarification on the jumper. I will cut the trace and enable the debugging mode.

    I should have time to work on this tomorrow night… hopefully. I will let you know if this works!

  29. March 24th, 2015 at 16:04 | #29

    @ArduinoinNE
    Okay great ;)

  30. Daniel
    April 2nd, 2015 at 17:59 | #30

    I am having a similar problem with my USB Host Shield.
    My Reciever works perfectly when connected to my PC but it will not register when connected to the USB Host Shield.

    I tried running the USB Host Shield Test program that you posted above and I just got trash on the serial monitor

    0€ðƒZ\ÛÓZRåÿÿÿÿÿÿÿÿÿ™!_¤Û°ÎPè]×

    or if i type anything in the command line, I get

    0€ðƒZ\ÛÓZRåÿÿÿÿÿÿÿÿÿ™!_¤Û°ÎPè]×4‚ZQ”Ëw}›Kð/æa,I›8Ï Z
    š5¼ÍCZ¾²xX ‘¢“ú¾–‹X88ž»N—€SZ®¸xš4”°&3Ú¾²X:t¢°ëI;ÊÌÉ4aºx¶½MCZ¾°xX ‘šȬ,’¾S–‹X88Ž”»•N—€QZ®ºxš4´ÍÃÚ¾²X:t¢0ëiÊÌÉ4aºx´½MSZ®°xX‰’šÈP,’¾–‹X88ž”¿•N—€®ºx¶ñ’šQohð4�I�`˜Ù¾Qr–‹š08†F�9]q¬˜¸H—Z‰’šȬ,’¾–‹/88Ž”¿•N—€®»x¶ñN4¢èT‚¶SO À›�E¿‘0–ÉQaºx´ž�ISZ®²xš ‘šÈP,’¾–Ë/8Ž”¿‘N—€6¬ºxšž4¼ÍCZ¾²–“-�þ,Ú

    I’m wondering if this means that the USB Host Shield was not made properly or if I am doing something wrong.

  31. April 2nd, 2015 at 23:09 | #31

    @Daniel
    You need to set the baud rate to 115200 in the serial monitor. Look in the bottom right.

  32. ArduinoinNE
    April 4th, 2015 at 21:08 | #32

    @Lauszus
    I cut the trace and just ran a jumper from the 5v hole to the VBUS hole and it didn’t work, even though it was measuring around 4.96 volts. The Wireless Xbox Receiver will turn on and blink green. I turn the controller on and press the connect key on the controller… and then the Wireless Xbox Receiver turns off. The shield appears to be defective. I’m totally frustrated… I really wanted this to work!

    Do you have a specific USB Host shield you would recommend?

  33. April 5th, 2015 at 00:11 | #33

    @ArduinoinNE
    Yes, the official one. You can buy it directly from me: http://shop.tkjelectronics.dk/ or from the following website: http://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino.

  34. ArduinoinNE
    April 9th, 2015 at 02:06 | #34

    @Kristian Lauszus
    I just got the official Arduino USB Host Shield in and everything is working! NICE job on writing the library Sir! Very cool!

    For some reason the controller will start vibrating after a while and I have to hold the L & R Triggers, the L1 & R1 bumpers and push both the L & R sticks forward to get it to stop. I’m not why it does that… any ideas why the controller starts vibrating? The battery level is at “3.”

  35. April 9th, 2015 at 12:45 | #35

    @ArduinoinNE
    The example turns on the rumble when L2 or R2 is pressed. Please see: https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Xbox/XBOXRECV/XBOXRECV.ino#L40.

  36. Sam W
    April 12th, 2015 at 22:28 | #36

    @Lauszus
    I managed to get my shield working with my 360 receiver. Per your instructions to @ArduinoinNE I cut the 3.3V VBUS jumper and jumped the 5V power select and I was able to get 5V out to the USB port. My receiver is now working perfectly. Thanks to both of you for helping me resolve this!

  37. April 14th, 2015 at 15:18 | #37

    @Sam W
    You are welcome :) Glad to hear you got it working!

  38. Ivan
    April 23rd, 2015 at 02:11 | #38

    Hola, soy de argentina asique talvez no entiendas esto, si no lo entiendes te lo traducire:
    Para empezar, me encanto tu aporte, me es muy util, busco controlar un cuadricoptero con el control del xbox 360… Me surge el problema de que necesito utilizar los pines PWM y solo puedo utilizar los pines 3,5y6 de mi Arduino UNO, debido a que los pines 11,10y 9 me los deja como valores de tension fijos de salida que no puedo sacar, y si los intento sacar el arduino se tilda y no me reconoce mas el joystick… ¿El problema se debe al programa XBOXRECV.ino o se debera a mi USB Host Shield, el cual es USB Host Shield 2.0 “Arduino meets Android”?

    Desde ya, muchas gracias!!

  39. Jacob
    April 23rd, 2015 at 19:25 | #39

    @Lauszus

    I have the arduino usb shield but it doesn’t have the GPOUT and GPIN pins. How can I get this thing to work correctly or will I need to get one that does have them. Here is what I have… http://store.arduino.cc/product/A000004 any help would be great.

    Thanks

  40. April 27th, 2015 at 23:48 | #40

    @Ivan
    Pin 10 and 9 and be rerouted: https://github.com/felis/USB_Host_Shield_2.0#interface-modifications, but 13, 12 and 11 can not, as they are used for SPI on the Uno.

    @Jacob
    You will have to get the official shield which have those pins broken out. You can buy it from our webshop: http://shop.tkjelectronics.dk/product_info.php?products_id=43 or https://www.circuitsathome.com/products-page/arduino-shields.

  41. Aqmal
    May 4th, 2015 at 16:56 | #41

    I’m working on a project to turn on and off an led my clicking a button from xbox 360 controller. I want to make it toggle button, not hold. Anybody help me to code????

  42. May 4th, 2015 at 20:02 | #42

    @Aqmal
    I have replied to you at the Github issue: https://github.com/felis/USB_Host_Shield_2.0/issues/149.

  43. May 21st, 2015 at 10:46 | #43

    Thank you for your work.
    I want to know how to use servo with xbox360 controller(wired) +arduino usb host shieid
    I did your XBOXUSB exemple file succesfully with arduino IDE 1.6.4 version.

    But I can’t let the servo move by RightHat X .
    Would you please give me simple servo control example code?

  44. Shlomo
    May 22nd, 2015 at 09:49 | #44

    Thank you very much for making this library. Now R/C projects look impressive and professional.
    I appreciate if someone could help with the following issue:
    I have Arduino pro mini with its dedicated host shield connected to wireless XBOX receiver.
    Everything works great only if the receiver was already paired right before on my PC.
    The XBOX receiver is not original and refuses to pair if attached to the USB host shield.
    So on the PC I force windows to use the original Microsoft driver for the receiver as it apears as unknown device when attached.
    So on the PC I pair the receiver with the controller, then unplug it from the PC and immediately connect it to the USB shield.
    From now on as long as I don’t turn off the power everything works fine with the Arduino.
    If Arduino power is turned off then I have to repeat the whole process again.
    My question is:
    How can I make a change in the library to configure the compatible wireless receiver although it doesn’t identify itself as genuine one? (it is the only device I intend to connect with this modified library).
    I tried to enable debug for XBOXRECV but nothing is printed.
    I also tried to put Serial.print(“test”) in the init function and nothing is printed.
    So I guess that already inside the USB task the device is unknown and XBOXRECV functions have never called. But maybe I missing something here.
    Thank you for you kind help.

  45. Shlomo
    May 22nd, 2015 at 13:47 | #45

    I also tried to fool the vid, pid, class and subclass according to info I found (*) but it didn’t help either:
    udd->idVendor = 0x045e; // microsoft
    udd->idProduct = 0x0719; // wireless receiver
    udd->bDeviceClass = 255;
    udd->bDeviceSubClass = 255;

    * http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/WirelessUsbInfo

  46. June 7th, 2015 at 15:11 | #46

    @Kim
    You should simply servo library: http://www.arduino.cc/en/Reference/Servo and then the map function to mat the readings from the joystick to values for the servo: http://www.arduino.cc/en/Reference/Map.

    @Shlomo
    I have never had that problem. I can both pair and connect with the Xbox receiver without any issues.

    You can not change the PID or VID on the controller. You should enable serial debugging: https://github.com/felis/USB_Host_Shield_2.0#enable-debugging and then copy & paste the output when you plug in the receiver.

Comment pages
1 2 3791
  1. January 2nd, 2013 at 22:38 | #1
  2. February 17th, 2013 at 15:32 | #2