<p>The shield can be purchased at the main site: <ahref="http://www.circuitsathome.com/products-page/arduino-shields">http://www.circuitsathome.com/products-page/arduino-shields</a> or from <ahref="http://tkjelectronics.com/">TKJ Electronics</a>: <ahref="http://shop.tkjelectronics.dk/product_info.php?products_id=43">http://shop.tkjelectronics.dk/product_info.php?products_id=43</a>.</p>
<li>Developers of the <aclass="el"href="class_u_s_b.html">USB</a> Core, <aclass="el"href="class_h_i_d.html">HID</a>, <aclass="el"href="class_f_t_d_i.html">FTDI</a>, <aclass="el"href="class_a_d_k.html">ADK</a>, <aclass="el"href="class_a_c_m.html">ACM</a>, and <aclass="el"href="class_p_l2303.html">PL2303</a> libraries</li>
<li>Developer of the <ahref="#bluetooth-libraries">BTD</a>, <ahref="#bthid-library">BTHID</a>, <ahref="#spp-library">SPP</a>, <ahref="#ps3-library">PS3</a>, <ahref="#wii-library">Wii</a>, and <ahref="#xbox-library">Xbox</a> libraries</li>
<p>First download the library by clicking on the following link: <ahref="https://github.com/felis/USB_Host_Shield_2.0/archive/master.zip">https://github.com/felis/USB_Host_Shield_2.0/archive/master.zip</a>.</p>
<p>Then uncompress the zip folder and rename the directory to "USB\_Host\_Shield\_20", as any special characters are not supported by the Arduino IDE.</p>
<p>Now open up the Arduino IDE and open "File>Preferences". There you will see the location of your sketchbook. Open that directory and create a directory called "libraries" inside that directory. Now move the "USB\_Host\_Shield\_20" directory to the "libraries" directory.</p>
<p>Now you should be able to go open all the examples codes by navigating to "File>Examples>USB\_Host\_Shield\_20" and then select the example you will like to open.</p>
<p>Documentation for the library can be found at the following link: <ahref="http://felis.github.com/USB_Host_Shield_2.0/">http://felis.github.com/USB_Host_Shield_2.0/</a>.</p>
<p>By default serial debugging is disabled. To turn it on simply change <code>ENABLE_UHS_DEBUGGING</code> to 1 in <ahref="settings.h">settings.h</a> like so:</p>
<p>``` #define ENABLE_UHS_DEBUGGING 1 ```</p>
<h3>Boards</h3>
<p>Currently the following boards are supported by the library:</p>
<ul>
<li>All official Arduino AVR boards (Uno, Duemilanove, Mega, Mega 2560, Mega <aclass="el"href="class_a_d_k.html">ADK</a>, Leonardo etc.)</li>
<li>Teensy (Teensy++ 1.0, Teensy 2.0, Teensy++ 2.0, and Teensy 3.0)</li>
<li>Balanduino</li>
<li>Sanguino</li>
<li>Black Widdow</li>
</ul>
<p>The following boards need to be activated manually in <ahref="settings.h">settings.h</a>:</p>
<ul>
<li>Arduino Mega <aclass="el"href="class_a_d_k.html">ADK</a><ul>
<li>If you are using Arduino 1.5.5 or newer there is no need to activate the Arduino Mega <aclass="el"href="class_a_d_k.html">ADK</a> manually</li>
</ul>
</li>
<li>Black Widdow</li>
</ul>
<p>Simply set the corresponding value to 1 instead of 0.</p>
<p>The <ahref="BTD.cpp">BTD library</a> is a general purpose library for an ordinary Bluetooth dongle. This library make it easy to add support for different Bluetooth services like a PS3 or a Wii controller or <aclass="el"href="class_s_p_p.html">SPP</a> which is a virtual serial port via Bluetooth. Some different examples can be found in the <ahref="examples/Bluetooth">example directory</a>.</p>
<p>The <aclass="el"href="class_b_t_d.html">BTD</a> library will also make it possible to use multiple services at once, the following example sketch is an example of this: <ahref="https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3SPP/PS3SPP.ino">https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3SPP/PS3SPP.ino</a>.</p>
<h3><ahref="BTHID.cpp">BTHID library</a></h3>
<p>The <ahref="BTHID.cpp">Bluetooth HID library</a> allows you to connect <aclass="el"href="class_h_i_d.html">HID</a> devices via Bluetooth to the <aclass="el"href="class_u_s_b.html">USB</a> Host Shield.</p>
<p>Currently <aclass="el"href="class_h_i_d.html">HID</a> mice and keyboards are supported.</p>
<p>It uses the standard Boot protocol by default, but it is also able to use the Report protocol as well. You would simply have to call <code>setProtocolMode()</code> and then parse <code>HID_RPT_PROTOCOL</code> as an argument. You will then have to modify the parser for your device. See the example: <ahref="https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/BTHID/BTHID.ino">https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/BTHID/BTHID.ino</a> for more information.</p>
<p><aclass="el"href="class_s_p_p.html">SPP</a> stands for "Serial Port Profile" and is a Bluetooth protocol that implements a virtual comport which allows you to send data back and forth from your computer/phone to your Arduino via Bluetooth. It has been tested successfully on Windows, Mac OS X, Linux, and Android.</p>
<p>To implement the <aclass="el"href="class_s_p_p.html">SPP</a> protocol I used a Bluetooth sniffing tool called <ahref="http://www.tkjelectronics.com/uploads/PacketLogger.zip">PacketLogger</a> developed by Apple. It enables me to see the Bluetooth communication between my Mac and any device.</p>
<p>These libraries consist of the <ahref="PS3BT.cpp">PS3BT</a> and <ahref="PS3USB.cpp">PS3USB</a>. These libraries allows you to use a Dualshock 3, Navigation or a Motion controller with the <aclass="el"href="class_u_s_b.html">USB</a> Host Shield both via Bluetooth and <aclass="el"href="class_u_s_b.html">USB</a>.</p>
<p>In order to use your Playstation controller via Bluetooth you have to set the Bluetooth address of the dongle internally to your PS3 Controller. This can be achieved by plugging the controller in via <aclass="el"href="class_u_s_b.html">USB</a> and letting the library set it automatically.</p>
<p><b>Note:</b> To obtain the address you have to plug in the Bluetooth dongle before connecting the controller, or alternatively you could set it in code like so: <ahref="https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3BT/PS3BT.ino#L15">https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3BT/PS3BT.ino#L15</a>.</p>
<p>For more information about the PS3 protocol see the official wiki: <ahref="https://github.com/felis/USB_Host_Shield_2.0/wiki/PS3-Information">https://github.com/felis/USB_Host_Shield_2.0/wiki/PS3-Information</a>.</p>
<p>A special thanks go to the following people:</p>
<oltype="1">
<li><em>Richard Ibbotson</em> who made this excellent guide: <ahref="http://www.circuitsathome.com/mcu/ps3-and-wiimote-game-controllers-on-the-arduino-host-shield-part">http://www.circuitsathome.com/mcu/ps3-and-wiimote-game-controllers-on-the-arduino-host-shield-part</a></li>
<li><em>Tomoyuki Tanaka</em> for releasing his code for the Arduino <aclass="el"href="class_u_s_b.html">USB</a> Host shield connected to the wiimote: <ahref="http://www.circuitsathome.com/mcu/rc-car-controlled-by-wii-remote-on-arduino">http://www.circuitsathome.com/mcu/rc-car-controlled-by-wii-remote-on-arduino</a></li>
</ol>
<p>Also a big thanks all the people behind these sites about the Motion controller:</p>
<p>The library supports both the original Xbox controller via <aclass="el"href="class_u_s_b.html">USB</a> and the Xbox 360 controller both via <aclass="el"href="class_u_s_b.html">USB</a> and wirelessly.</p>
<h4>Xbox library</h4>
<p>The <ahref="XBOXOLD.cpp">XBOXOLD</a> class implements support for the original Xbox controller via <aclass="el"href="class_u_s_b.html">USB</a>.</p>
<p>All the information are from the following sites:</p>
<p>The library support one Xbox 360 via <aclass="el"href="class_u_s_b.html">USB</a> or up to four Xbox 360 controllers wirelessly by using a <ahref="http://blog.tkjelectronics.dk/wp-content/uploads/xbox360-wireless-receiver.jpg">Xbox 360 wireless receiver</a>.</p>
<p>To use it via <aclass="el"href="class_u_s_b.html">USB</a> use the <ahref="XBOXUSB.cpp">XBOXUSB</a> library or to use it wirelessly use the <ahref="XBOXRECV.cpp">XBOXRECV</a> library.</p>
<p>The <ahref="Wii.cpp">Wii</a> library support the Wiimote, but also the Nunchuch and Motion Plus extensions via Bluetooth. The Wii U Pro Controller is also supported via Bluetooth.</p>
<p>Take a look at the example for more information: <ahref="https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/Wii/Wii.ino">https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/Wii/Wii.ino</a>.</p>
<li>The old library created by <em>Tomoyuki Tanaka</em>: <ahref="https://github.com/moyuchin/WiiRemote_on_Arduino">https://github.com/moyuchin/WiiRemote_on_Arduino</a> also helped a lot.</li>
</ul>
<h1>FAQ</h1>
<blockquoteclass="doxtable">
<p>When I plug my device into the <aclass="el"href="class_u_s_b.html">USB</a> connector nothing happens?</p>
<p></p>
</blockquote>
<p>Try to connect a external power supply to the Arduino - this solves the problem in most cases. </p>