1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META http-equiv="Content-Style-Type" content="text/css"> 6<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 7<title>KPADOld sample demo program (kpadsample)</title> 8</head> 9 10<body> 11 12<h1>kpadsample (KPADOld)</h1> 13 14<h2>Location</h2> 15<p> 16<code>$REVOLUTION_SDK_ROOT/build/demos/kpadOlddemo</code> 17</p> 18 19<H2>Description</H2> 20<p> 21This sample program verifies KPADOld library functionality.<BR>Values obtained from the library can be displayed on the screen and values that can be modified by the library can be edited.<BR> 22</p> 23 24<h3>Screen Display</h3> 25<TABLE border="1" cellpadding="3" cellspacing="0.1" width="95%"> 26 <TBODY> 27 <TR> 28<TD>POINTING</TD> 29<TD>The scaling value used for determining the on-screen position; it is the factor by which you multiply the <SPAN class="argument">pos</SPAN> member variable of the <A HREF="../KPADStatus.html"><CODE>KPADStatus</CODE></A> structure. The blue frame displayed on the screen shows a range of +/-1 for <SPAN class="argument">pos</SPAN>.</TD> 30 </TR> 31 <TR> 32<TD>INTERVAL</TD> 33<TD>Indicates the interval (in meters) between the two sensors on the Sensor Bars.</TD> 34 </TR> 35 <TR> 36<TD>POS HOR DIS ACC - PLAY SENS</TD> 37<TD>Shows the play radius (<code>play_radius</code>) and sensitivity (<code>sensitivity</code>) set for the <SPAN class="argument">pos</SPAN>,<SPAN class="argument">horizon</SPAN>,<SPAN class="argument">dist</SPAN>, and <SPAN class="argument">acc</SPAN> in the <A HREF="../KPADStatus.html"><CODE>KPADStatus</CODE></A> structure.</TD> 38 </TR> 39 <TR> 40<TD>RPT - DLAY PLUS</TD> 41<TD>Indicates the repeat start time (<code>delay_sec</code>) and the repeat interval (<code>pulse_sec</code>) of the digital button.</TD> 42 </TR> 43 <TR> 44<TD>HLD</TD> 45<TD>Displays the binary value of the flag set when a digital button is held down (<code>hold</code>) .</TD> 46 </TR> 47 <TR> 48<TD>TRG</TD> 49<TD>Displays the binary value of the flag set when a digital button is pressed (<code>trig</code>).</TD> 50 </TR> 51 <TR> 52<TD>REL</TD> 53<TD>Displays the binary value of the flag set when a digital button is released (<code>release</code>).</TD> 54 </TR> 55 <TR> 56<TD>ACC</TD> 57<TD>Indicates the <SPAN class="argument">acc</SPAN> information of the <A HREF="../KPADStatus.html"><CODE>KPADStatus</CODE></A> structure as a vector in the 2D-xy-plane and a vector in the 2D-zy-plane (arrows are solid lines). When a Nunchuk is installed, the <SPAN class="argument">fs.acc</SPAN> information of the <A HREF="../KPADEXStatus.html"><CODE>KPADEXStatus</CODE></A> structure is displayed the same way (arrows are dotted lines).</TD> 58 </TR> 59 <TR> 60<TD>VALID</TD> 61<TD>Indicates the <SPAN class="argument">dpd_valid_fg</SPAN> value of the <A HREF="../KPADStatus.html"><CODE>KPADStatus</CODE></A> structure.</TD> 62 </TR> 63 <TR> 64<TD>DIST</TD> 65<TD>Indicates the <SPAN class="argument">dist</SPAN> value of the <A HREF="../KPADStatus.html"><CODE>KPADStatus</CODE></A> structure.</TD> 66 </TR> 67 <TR> 68<TD>OBJ</TD> 69<TD>Indicates the position of the object captured by the DPD. The rectangle is the sensor range.</TD> 70 </TR> 71 </TBODY> 72</TABLE> 73 74<h3>Parameter Adjustment</h3> 75<p> 76The values can be edited using the digital buttons. Move the cursor using the +Control Pad, and use the A Button to increment the value for that digit, and the B Button to decrement it.<BR> 77</p> 78 79<h3>Calibration</h3> 80<p> 81Calibration is required if the Sensor Bar is not level or if the accelerometer returns values that are off by a large amount. One example of this is when the Wii Remote is held in a horizontal position but the acceleration sensor returns values that differ considerably from those of a horizontal position. The calibration process corrects the value of the <A HREF="../KPADStatus.html"><CODE>KPADStatus</CODE></A> structure's <SPAN class="argument">horizon</SPAN> member variable; the <SPAN class="argument">acc</SPAN> member variable is not affected. 82</p> 83<p> 84To activate calibration, press the + Button and - Button simultaneously. Be sure that the controller is in a horizontal position and that only two sensors are detected. If one or three sensors are detected, calibration will fail. If calibration succeeds, CALIBRATE is displayed on the screen; if calibration fails, ERROR is displayed.<br> 85</p> 86 87<h3>Nunchuk</h3> 88<p> 89When the Nunchuk's Control Stick is moved, the movement is displayed on the TV screen as a yellow, dashed-line arrow. 90</p> 91 92<h3>Classic Controller</h3> 93<p> 94The <I>kpadsample</I> demo supports the Classic Controller. When a Classic Controller is connected to a Wii Remote, the state of the digital buttons (pressed/not pressed) on the Classic Controller will be displayed in the lower part of the TV screen. Movements of the Classic Controller L Stick and R Stick are displayed on the screen using blue and green arrows, respectively. 95</p> 96 97<h3>DPD ON/OFF</h3> 98<p> 99To turn the DPD feature ON, press the 1 Button on the Wii Remote; to turn it OFF, press the 2 Button. 100</p> 101 102<h3>Aiming Mode ON/OFF</h3> 103<p> 104When HOME on the Wii Remote is pressed, the aiming mode, which can be set using the <a href="../KPADEnableAimingMode.html"><CODE>KPADEnableAimingMode</CODE></a> and <a href="../KPADDisableAimingMode.html"><CODE>KPADDisableAimingMode</CODE></a> functions, is switched. 105</p> 106 107<h3>Source Code Files</h3> 108<TABLE border="1" cellpadding="3" cellspacing="0.1" width="95%"> 109 <TBODY> 110 <TR> 111<TD><CODE>main.h</CODE><BR><CODE>main.c</CODE></TD> 112<TD>Contains the application startup and framework source. Controllers are initialized and loaded in these files.</TD> 113 </TR> 114 <TR> 115<TD><CODE>sample.h</CODE><BR><CODE>sample.c</CODE></TD> 116<TD>This application performs a variety of operations with the controller values. Contains the source for CPU and the drawing processes performed in each frame.</TD> 117 </TR> 118 <TR> 119<TD><CODE>graphic.h</CODE><BR><CODE>graphic.c</CODE></TD> 120<TD>The collection of subroutines for simple graphics drawing.</TD> 121 </TR> 122 <TR> 123<TD><CODE>kfont.h</CODE><BR><CODE>kfont.c</CODE></TD> 124<TD>The collection of subroutines that display text and values on the screen.</TD> 125 </TR> 126 </TBODY> 127</TABLE> 128 129<h2>See Also</h2> 130<P>None.</P> 131 132<H2>Revision History</H2> 133<P> 1342006/10/25 Changed the name to KPADOld library, beginning with Revolution SDK 2.3.<br>2006/09/07 Added information about turning the aiming mode ON and OFF.<br>2006/08/30 Added information about operating the Nunchuk and Classic Controller.<br>2006/08/30 Added information about the ON/OFF operation of the DPD functionality.<br>2006/06/19 Changed tentative product name to official name.<br>2006/03/01 Initial version.<br> 135</P> 136 137<hr><p>CONFIDENTIAL</p></body> 138</html>