USB_Host_Shield_2.0/index.html
2014-01-19 17:17:06 +01:00

272 lines
24 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>USB Host Shield 2.0: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="imageStyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">USB Host Shield 2.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">USB Host Shield 2.0 Documentation</div> </div>
</div><!--header-->
<div class="contents">
<div class="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 <a class="el" href="class_u_s_b.html">USB</a> Host Shield Library for AVR's.</p>
<p>Project main web site is: <a href="http://www.circuitsathome.com">http://www.circuitsathome.com</a>.</p>
<p>Some information can also be found at: <a href="http://blog.tkjelectronics.dk/">http://blog.tkjelectronics.dk/</a>.</p>
<p>The shield can be purchased at the main site: <a href="http://www.circuitsathome.com/products-page/arduino-shields">http://www.circuitsathome.com/products-page/arduino-shields</a> or from <a href="http://tkjelectronics.com/">TKJ Electronics</a>: <a href="http://shop.tkjelectronics.dk/product_info.php?products_id=43">http://shop.tkjelectronics.dk/product_info.php?products_id=43</a>.</p>
<div class="image">
<img src="http://www.circuitsathome.com/wp/wp-content/uploads/2012/02/UHS_20_main-288x216.jpg" alt="USB Host Shield"/>
</div>
<p>For more information about the hardware see the <a href="http://www.circuitsathome.com/usb-host-shield-hardware-manual">Hardware Manual</a>.</p>
<h1>Developed By</h1>
<ul>
<li><b>Oleg Mazurov, Circuits@Home</b> - <a href="#" onclick="location.href='mai'+'lto:'+'maz'+'ur'+'ov@'+'ci'+'rcu'+'it'+'sat'+'ho'+'me.'+'co'+'m'; return false;">mazur<span style="display: none;">.nosp@m.</span>ov@c<span style="display: none;">.nosp@m.</span>ircui<span style="display: none;">.nosp@m.</span>tsat<span style="display: none;">.nosp@m.</span>home.<span style="display: none;">.nosp@m.</span>com</a></li>
<li><b>Alexei Glushchenko, Circuits@Home</b> - <a href="#" onclick="location.href='mai'+'lto:'+'ale'+'x-'+'gl@'+'ma'+'il.'+'ru'; return false;">alex-<span style="display: none;">.nosp@m.</span>gl@m<span style="display: none;">.nosp@m.</span>ail.r<span style="display: none;">.nosp@m.</span>u</a><ul>
<li>Developers of the <a class="el" href="class_u_s_b.html">USB</a> Core, <a class="el" href="class_h_i_d.html">HID</a>, <a class="el" href="class_f_t_d_i.html">FTDI</a>, <a class="el" href="class_a_d_k.html">ADK</a>, <a class="el" href="class_a_c_m.html">ACM</a>, and <a class="el" href="class_p_l2303.html">PL2303</a> libraries</li>
</ul>
</li>
<li><b>Kristian Lauszus, TKJ Electronics</b> - <a href="#" onclick="location.href='mai'+'lto:'+'kri'+'st'+'ian'+'l@'+'tkj'+'el'+'ect'+'ro'+'nic'+'s.'+'com'; return false;">krist<span style="display: none;">.nosp@m.</span>ianl<span style="display: none;">.nosp@m.</span>@tkje<span style="display: none;">.nosp@m.</span>lect<span style="display: none;">.nosp@m.</span>ronic<span style="display: none;">.nosp@m.</span>s.co<span style="display: none;">.nosp@m.</span>m</a><ul>
<li>Developer of the <a href="#bluetooth-libraries">BTD</a>, <a href="#bthid-library">BTHID</a>, <a href="#spp-library">SPP</a>, <a href="#ps4-library">PS4</a>, <a href="#ps3-library">PS3</a>, <a href="#wii-library">Wii</a>, and <a href="#xbox-library">Xbox</a> libraries</li>
</ul>
</li>
<li><b>Andrew Kroll</b> - <a href="#" onclick="location.href='mai'+'lto:'+'xxx'+'aj'+'k@g'+'ma'+'il.'+'co'+'m'; return false;">xxxaj<span style="display: none;">.nosp@m.</span>k@gm<span style="display: none;">.nosp@m.</span>ail.c<span style="display: none;">.nosp@m.</span>om</a><ul>
<li>Major contributor to mass storage code</li>
</ul>
</li>
</ul>
<h1>How to include the library</h1>
<p>First download the library by clicking on the following link: <a href="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&gt;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>The final structure should look like this:</p>
<ul>
<li>Arduino/<ul>
<li>libraries/<ul>
<li>USB_Host_Shield_20/</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Now quit the Arduino IDE and reopen it.</p>
<p>Now you should be able to go open all the examples codes by navigating to "File&gt;Examples&gt;USB\_Host\_Shield\_20" and then select the example you will like to open.</p>
<p>For more information visit the following site: <a href="http://arduino.cc/en/Guide/Libraries">http://arduino.cc/en/Guide/Libraries</a>.</p>
<h1>How to use the library</h1>
<h3>Documentation</h3>
<p>Documentation for the library can be found at the following link: <a href="http://felis.github.com/USB_Host_Shield_2.0/">http://felis.github.com/USB_Host_Shield_2.0/</a>.</p>
<h3>Enable debugging</h3>
<p>By default serial debugging is disabled. To turn it on simply change <code>ENABLE_UHS_DEBUGGING</code> to 1 in <a href="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 <a class="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)<ul>
<li>Note if you are using the Teensy 3.0 you should download this SPI library as well: <a href="https://github.com/xxxajk/spi4teensy3">https://github.com/xxxajk/spi4teensy3</a>. You should then add <code>#include &lt;spi4teensy3.h&gt;</code> to your .ino file.</li>
</ul>
</li>
<li>Balanduino</li>
<li>Sanguino</li>
<li>Black Widdow</li>
</ul>
<p>The following boards need to be activated manually in <a href="settings.h">settings.h</a>:</p>
<ul>
<li>Arduino Mega <a class="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 <a class="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>
<h3><a href="BTD.cpp">Bluetooth libraries</a></h3>
<p>The <a href="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 <a class="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 <a href="examples/Bluetooth">example directory</a>.</p>
<p>The <a class="el" href="class_b_t_d.html">BTD</a> library also makes it possible to use multiple services at once, the following example sketch is an example of this: <a href="examples/Bluetooth/PS3SPP/PS3SPP.ino">PS3SPP.ino</a>.</p>
<h3><a href="BTHID.cpp">BTHID library</a></h3>
<p>The <a href="BTHID.cpp">Bluetooth HID library</a> allows you to connect <a class="el" href="class_h_i_d.html">HID</a> devices via Bluetooth to the <a class="el" href="class_u_s_b.html">USB</a> Host Shield.</p>
<p>Currently <a class="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: <a href="examples/Bluetooth/BTHID/BTHID.ino">BTHID.ino</a> for more information.</p>
<p>The <a href="#ps4-library">PS4 library</a> also uses this class to handle all Bluetooth communication.</p>
<p>For information see the following blog post: <a href="http://blog.tkjelectronics.dk/2013/12/bluetooth-hid-devices-now-supported-by-the-usb-host-library/">http://blog.tkjelectronics.dk/2013/12/bluetooth-hid-devices-now-supported-by-the-usb-host-library/</a>.</p>
<h3><a href="SPP.cpp">SPP library</a></h3>
<p><a class="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>Take a look at the <a href="examples/Bluetooth/SPP/SPP.ino">SPP.ino</a> example for more information.</p>
<p>More information can be found at these blog posts:</p>
<ul>
<li><a href="http://www.circuitsathome.com/mcu/bluetooth-rfcommspp-service-support-for-usb-host-2-0-library-released">http://www.circuitsathome.com/mcu/bluetooth-rfcommspp-service-support-for-usb-host-2-0-library-released</a></li>
<li><a href="http://blog.tkjelectronics.dk/2012/07/rfcommspp-library-for-arduino/">http://blog.tkjelectronics.dk/2012/07/rfcommspp-library-for-arduino/</a></li>
</ul>
<p>To implement the <a class="el" href="class_s_p_p.html">SPP</a> protocol I used a Bluetooth sniffing tool called <a href="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>PS4 Library</h3>
<p>The <a class="el" href="class_p_s4_b_t.html">PS4BT</a> library is split up into the <a href="PS4BT.h">PS4BT</a> and the <a href="PS4USB.h">PS4USB</a> library. These allow you to use the Sony PS4 controller via Bluetooth and <a class="el" href="class_u_s_b.html">USB</a>.</p>
<p>The <a href="examples/Bluetooth/PS4BT/PS4BT.ino">PS4BT.ino</a> and <a href="examples/PS4USB/PS4USB.ino">PS4USB.ino</a> examples shows how to easily read the buttons and joysticks on the controller via Bluetooth and <a class="el" href="class_u_s_b.html">USB</a> respectively.</p>
<p>I still have not figured out how to turn rumble on and off and set the color of the light, but hopefully I will figure that out soon.</p>
<p>Also the gyro, accelerometer and touchpad values are still only available via <a class="el" href="class_u_s_b.html">USB</a> at the moment.</p>
<p>Before you can use the PS4 controller via Bluetooth you will need to pair with it.</p>
<p>Simply create the <a class="el" href="class_p_s4_b_t.html">PS4BT</a> instance like so: <code><a class="el" href="class_p_s4_b_t.html">PS4BT</a> PS4(&amp;Btd, PAIR);</code> and then hold down the PS and Share button at the same time, the PS4 controller will then start to blink rapidly indicating that it is in paring mode.</p>
<p>It should then automatically pair the dongle with your controller. This only have to be done once.</p>
<p>For information see the following blog post: <a href="http://blog.tkjelectronics.dk/2014/01/ps4-controller-now-supported-by-the-usb-host-library/">http://blog.tkjelectronics.dk/2014/01/ps4-controller-now-supported-by-the-usb-host-library/</a>.</p>
<h3>PS3 Library</h3>
<p>These libraries consist of the <a href="PS3BT.cpp">PS3BT</a> and <a href="PS3USB.cpp">PS3USB</a>. These libraries allows you to use a Dualshock 3, Navigation or a Motion controller with the <a class="el" href="class_u_s_b.html">USB</a> Host Shield both via Bluetooth and <a class="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 <a class="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: <a href="examples/Bluetooth/PS3BT/PS3BT.ino#L20">PS3BT.ino::L20</a>.</p>
<p>For more information about the PS3 protocol see the official wiki: <a href="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>Also take a look at the blog posts:</p>
<ul>
<li><a href="http://blog.tkjelectronics.dk/2012/01/ps3-controller-bt-library-for-arduino/">http://blog.tkjelectronics.dk/2012/01/ps3-controller-bt-library-for-arduino/</a></li>
<li><a href="http://www.circuitsathome.com/mcu/sony-ps3-controller-support-added-to-usb-host-library">http://www.circuitsathome.com/mcu/sony-ps3-controller-support-added-to-usb-host-library</a></li>
<li><a href="http://www.circuitsathome.com/mcu/arduino/interfacing-ps3-controllers-via-usb">http://www.circuitsathome.com/mcu/arduino/interfacing-ps3-controllers-via-usb</a></li>
</ul>
<p>A special thanks go to the following people:</p>
<ol type="1">
<li><em>Richard Ibbotson</em> who made this excellent guide: <a href="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 <a class="el" href="class_u_s_b.html">USB</a> Host shield connected to the wiimote: <a href="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>
<ul>
<li><a href="http://thp.io/2010/psmove/">http://thp.io/2010/psmove/</a></li>
<li><a href="http://www.copenhagengamecollective.org/unimove/">http://www.copenhagengamecollective.org/unimove/</a></li>
<li><a href="https://github.com/thp/psmoveapi">https://github.com/thp/psmoveapi</a></li>
<li><a href="http://code.google.com/p/moveonpc/">http://code.google.com/p/moveonpc/</a></li>
</ul>
<h3>Xbox Libraries</h3>
<p>The library supports both the original Xbox controller via <a class="el" href="class_u_s_b.html">USB</a> and the Xbox 360 controller both via <a class="el" href="class_u_s_b.html">USB</a> and wirelessly.</p>
<h4>Xbox library</h4>
<p>The <a href="XBOXOLD.cpp">XBOXOLD</a> class implements support for the original Xbox controller via <a class="el" href="class_u_s_b.html">USB</a>.</p>
<p>All the information are from the following sites:</p>
<ul>
<li><a href="https://github.com/torvalds/linux/blob/master/Documentation/input/xpad.txt">https://github.com/torvalds/linux/blob/master/Documentation/input/xpad.txt</a></li>
<li><a href="https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c">https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c</a></li>
<li><a href="http://euc.jp/periphs/xbox-controller.ja.html">http://euc.jp/periphs/xbox-controller.ja.html</a></li>
<li><a href="https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL#L15">https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL#L15</a></li>
</ul>
<h4>Xbox 360 Library</h4>
<p>The library support one Xbox 360 via <a class="el" href="class_u_s_b.html">USB</a> or up to four Xbox 360 controllers wirelessly by using a <a href="http://blog.tkjelectronics.dk/wp-content/uploads/xbox360-wireless-receiver.jpg">Xbox 360 wireless receiver</a>.</p>
<p>To use it via <a class="el" href="class_u_s_b.html">USB</a> use the <a href="XBOXUSB.cpp">XBOXUSB</a> library or to use it wirelessly use the <a href="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 <a href="examples/Xbox">examples directory</a>.</p>
<p>Also see the following blog posts:</p>
<ul>
<li><a href="http://www.circuitsathome.com/mcu/xbox360-controller-support-added-to-usb-host-shield-2-0-library">http://www.circuitsathome.com/mcu/xbox360-controller-support-added-to-usb-host-shield-2-0-library</a></li>
<li><a href="http://blog.tkjelectronics.dk/2012/07/xbox-360-controller-support-added-to-the-usb-host-library/">http://blog.tkjelectronics.dk/2012/07/xbox-360-controller-support-added-to-the-usb-host-library/</a></li>
<li><a href="http://blog.tkjelectronics.dk/2012/12/xbox-360-receiver-added-to-the-usb-host-library/">http://blog.tkjelectronics.dk/2012/12/xbox-360-receiver-added-to-the-usb-host-library/</a></li>
</ul>
<p>All the information regarding the Xbox 360 controller protocol are form these sites:</p>
<ul>
<li><a href="http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/UsbInfo">http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/UsbInfo</a></li>
<li><a href="http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/WirelessUsbInfo">http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/WirelessUsbInfo</a></li>
<li><a href="https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL">https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL</a></li>
</ul>
<h3><a href="Wii.cpp">Wii library</a></h3>
<p>The <a href="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>First you have to pair with the controller, this is done automatically by the library if you create the instance like so:</p>
<p>``` <a class="el" href="class_w_i_i.html">WII</a> Wii(&amp;Btd,PAIR); ```</p>
<p>And then press 1 &amp; 2 at once on the Wiimote or press sync if you are using a Wii U Pro Controller.</p>
<p>After that you can simply create the instance like so:</p>
<p>``` <a class="el" href="class_w_i_i.html">WII</a> Wii(&amp;Btd); ```</p>
<p>Then just press any button on the Wiimote and it will then connect to the dongle.</p>
<p>Take a look at the example for more information: <a href="examples/Bluetooth/Wii/Wii.ino">Wii.ino</a>.</p>
<p>Also take a look at the blog post:</p>
<ul>
<li><a href="http://blog.tkjelectronics.dk/2012/08/wiimote-added-to-usb-host-library/">http://blog.tkjelectronics.dk/2012/08/wiimote-added-to-usb-host-library/</a></li>
</ul>
<p>The Wii IR camera can also be used, but you will have to activate the code for it manually as it is quite large. Simply set <code>ENABLE_WII_IR_CAMERA</code> to 1 in <a href="settings.h">settings.h</a>.</p>
<p>The <a href="examples/Bluetooth/WiiIRCamera/WiiIRCamera.ino">WiiIRCamera.ino</a> example shows how it can be used.</p>
<p>All the information about the Wii controllers are from these sites:</p>
<ul>
<li><a href="http://wiibrew.org/wiki/Wiimote">http://wiibrew.org/wiki/Wiimote</a></li>
<li><a href="http://wiibrew.org/wiki/Wiimote/Extension_Controllers">http://wiibrew.org/wiki/Wiimote/Extension_Controllers</a></li>
<li><a href="http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck">http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck</a></li>
<li><a href="http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Wii_Motion_Plus">http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Wii_Motion_Plus</a></li>
<li>The old library created by <em>Tomoyuki Tanaka</em>: <a href="https://github.com/moyuchin/WiiRemote_on_Arduino">https://github.com/moyuchin/WiiRemote_on_Arduino</a> also helped a lot.</li>
</ul>
<h1>FAQ</h1>
<blockquote class="doxtable">
<p>When I plug my device into the <a class="el" href="class_u_s_b.html">USB</a> connector nothing happens?</p>
<p></p>
</blockquote>
<ul>
<li>Try to connect a external power supply to the Arduino - this solves the problem in most cases.</li>
<li>You can also use a powered hub between the device and the <a class="el" href="class_u_s_b.html">USB</a> Host Shield. You should then include the <a class="el" href="class_u_s_b.html">USB</a> hub library: <code>#include &lt;<a class="el" href="usbhub_8h.html">usbhub.h</a>&gt;</code> and create the instance like so: <code><a class="el" href="class_u_s_b_hub.html">USBHub</a> Hub1(&amp;Usb);</code>. </li>
</ul>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>