<divclass="textblock"><p>The code is released under the GNU General Public License. </p>
<hr/>
<h1>Summary</h1>
<p>This is Revision 2.0 of MAX3421E-based <aclass="el"href="class_u_s_b.html">USB</a> Host Shield Library for AVR's.</p>
<p>Project main web site is: <ahref="http://www.circuitsathome.com">http://www.circuitsathome.com</a>.</p>
<p>Some information can also be found at: <ahref="http://blog.tkjelectronics.dk/">http://blog.tkjelectronics.dk/</a>.</p>
<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>.</p>
<li>Developer 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>
<p>To use this library with the official <ahref="http://arduino.cc/en/Main/ArduinoBoardADK">Arduino ADK</a> uncomment the following line in <ahref="https://github.com/felis/USB_Host_Shield_2.0/blob/master/avrpins.h">avrpins.h</a>:</p>
<p>The <ahref="https://github.com/felis/USB_Host_Shield_2.0/blob/master/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="https://github.com/felis/USB_Host_Shield_2.0/tree/master/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>
<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. Unfortunately Google broke something in Android 4.2, so it's currently not working in this version of Android.</p>
<p>More information can be found at these blog posts:</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>
<h3>PS3 Library</h3>
<p>These libraries consist of the <ahref="https://github.com/felis/USB_Host_Shield_2.0/blob/master/PS3BT.cpp">PS3BT</a> and <ahref="https://github.com/felis/USB_Host_Shield_2.0/blob/master/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#L12">https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3BT/PS3BT.ino#L12</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 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="https://github.com/felis/USB_Host_Shield_2.0/blob/master/XBOXUSB.cpp">XBOXUSB</a> library or to use it wirelessly use the <ahref="https://github.com/felis/USB_Host_Shield_2.0/blob/master/XBOXRECV.cpp">XBOXRECV</a> library.</p>
<p><b>Note that a Wireless controller can NOT be used via USB!</b></p>
<p>Examples code can be found in the <ahref="https://github.com/felis/USB_Host_Shield_2.0/tree/master/examples/Xbox">examples directory</a>.</p>
<p>The <ahref="https://github.com/felis/USB_Host_Shield_2.0/blob/master/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>Then just press any button any button on the Wiimote and it will connect to the dongle.</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>