Hi and thanks for reading this here post, lets get to it shall we?
The ultimate aim of this project use an Xbox Controller to control an RC boat.
I've to the point where I've got all the components but I'm lacking expertise.
I've got the following components:
Genuine arduino UNI
a keyes USB HOST shield
a Xbox one controller revision 2 (Model No. 1697)
I don't Know if it's because I have the newer version but having uploaded the basic sketch from the host shield 2.0 Library to the arduino no information other then the software is running is coming threw the serial monitor, also the light on the controller stays out.
I've run the diagnostics sketch for the host shield and it comes up working fine. I've exhausted my knowledge and would appreciate any kind of help!
well at the moment I'm trying simply to connect it threw a USB cable, because I assume that would be more likely to work. I do have, and have tried the wireless dongle but the two won't even bond let alone send return anything threw the serial monitor.
I'm not sure about the power requirements but this controller runs fine on the power provided to it from the USB port on my laptop. Though I suppose the arduino is taking some power for itself which might be the problem. (the controller still wont do anything when it has batteries inserted)
I'm running the XBOXONE sketch in the USB host shield library 2.0 under the xbox directory.
this is all I'm getting:
XBOX USB Library Started
XBOX USB Library Started
I get an initial buzz from the controller which might be to indicate hat it has power but nothing happens after that.
Based on the mouse working and the message "XBOX USB Library Started" appearing, the shield hardware is working. If the controller has a battery, it may also be pulling extra current for charging so external power might help.
The only other thing I can suggest is to turn on debug in the XBOXONE.cpp library code. Uncomment the #defines then see settings.h.
// To enable serial debugging see "settings.h"
//#define EXTRADEBUG // Uncomment to get even more debugging data
//#define PRINTREPORT // Uncomment to print the report send by the Xbox ONE Controller
/* Set this to 1 to activate serial debugging */ #define ENABLE_UHS_DEBUGGING 0
This is a long shot because I did not write this code and do not have a Xbox controller but perhaps the folks at circuits@home might find debug output helpful.
I got a PS3 Dual Shock clone via USB to work with a 1 line change to Usb.cpp. The controller was working a while back but does not work with the latest IDE and host library. The proposed fix comments out the data toggle flip because it seems to generate more data toggle errors instead of fixing them.
IDE 1.6.7
USB Host Shield library 2.0 version 1.2.1
This change affects just about all USB devices so use with caution. The USB keyboard still works with this change.
Usb.cpp lives in Arduino/libraries/USB_Host_Shield_Library_2.0.
@@ -234,7 +234,7 @@
rcode = dispatchPkt(tokIN, pep->epAddr, nak_limit); //IN packet to EP-'endpoint'. Function takes care of NAKS.
if(rcode == hrTOGERR) {
// yes, we flip it wrong here so that next time it is actually correct!
+ // no, do not flip it because it generates more toggle errors
+ //pep->bmRcvToggle = (regRd(rHRSL) & bmRCVTOGRD) ? 0 : 1;
- pep->bmRcvToggle = (regRd(rHRSL) & bmRCVTOGRD) ? 0 : 1;
regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value
continue;
}
If this works, I will send a pull request to circuits@home.
P.S. If this fix does not work, I suggest using library manager to install older versions of the USB Host Shield library. I found using version 1.0.0 works on the PS3 DS without the above fix.
I'm under the impression that what you'd like me to isn't in a sketch (I am very much a noob at programming and arduino as a hole)
I've tried opening the files in note pad but it's all on one like, any suggestion what what program I should use?
Any change you could send the altered files (or contents) and I could pop them in place?
I'm sorry for not being program literate, if it helps I'm fairly sure I've ruled put power issues. I Plugged the arduino, a mouse and the controller into a non powered (not powered other then from the USB port the arduino was plugged into in the first place) USB hub and every thing was happy power-wise so I'm left to conclude that its a programming issue. (unless anyone has any other suggestions)