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 onscreen 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">
26  <TBODY>
27    <TR>
28<TD>POINTING</TD>
29<TD>Indicates the scaling value for determining the onscreen position using the factor with which to multiply the <CODE>pos</CODE> member variable of the <code><A HREF="../KPADStatus.html">KPADStatus</A></code> structure. The blue frame that is displayed onscreen shows a range of +/-1 for <CODE>pos</CODE>.</TD>
30    </TR>
31    <TR>
32<TD>INTERVAL</TD>
33<TD>Indicates in meters the distance from the two Sensor Bar sensors.</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 <CODE>pos</CODE>, <CODE>horizon</CODE>, <CODE>dist</CODE>, and <CODE>acc</CODE> of the <CODE><A HREF="../KPADStatus.html">KPADStatus</A></CODE> 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>This binary flag (hold) indicates whether a digital button is being held down.</TD>
46    </TR>
47    <TR>
48<TD>TRG</TD>
49<TD>This binary flag (trig) indicates the instant a digital button is pressed.</TD>
50    </TR>
51    <TR>
52<TD>REL</TD>
53<TD>This binary flag (release) indicates the instant a digital button is released.</TD>
54    </TR>
55    <TR>
56<TD>ACC</TD>
57<TD>Indicates the <CODE>acc</CODE> 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 plugged in, the <code>fs.acc</code> information of the <A HREF="../KPADEXStatus.html"><code>KPADEXStatus</code></A> structure is displayed in the same way. (Arrows are dotted lines.)</TD>
58    </TR>
59    <TR>
60<TD>VALID</TD>
61<TD>Indicates the <code>dpd_valid_fg</code> value of the <code><A HREF="../KPADStatus.html">KPADStatus</A></code> structure.</TD>
62    </TR>
63    <TR>
64<TD>DIST</TD>
65<TD>Indicates the <CODE>dist</CODE> value of the <code><A HREF="../KPADStatus.html">KPADStatus</A></code> 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 with 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 for some reason or if the accelerometer returns values that are off by a large magnitude (for example, when the Wii Remote is held in a horizontal position, but the acceleration sensor returns values that differ greatly from the values for a horizontal position). The calibration process corrects the value of the <CODE>horizon</CODE> member of the <code><A HREF="../KPADStatus.html">KPADStatus</A></code> structure (the <CODE>acc</CODE> member variable is not affected).
82</p>
83<p>
84Calibration is activated by pressing the + Button and - Button simultaneously. Be sure the controller is in a horizontal position and that only two sensors are detected. If one or three sensors are detected, calibration fails. If calibration succeeds, CALIBRATE is displayed onscreen. If calibration fails, ERROR is displayed onscreen.
85</p>
86
87<h3>Nunchuk</h3>
88<p>
89When the Control Stick on the Nunchuk is moved, the movement is displayed on the TV screen as a yellow, broken-line, arrow.
90</p>
91
92<h3>Classic Controller</h3>
93<p>
94The kpadsample demo supports the Classic Controller. When a Classic Controller is connected to the Wii Remote, the state of the digital buttons (pressed or not) on the Classic Controller will be displayed on the lower part of the TV screen. Movements of the Classic Controller L Stick and R Stick are displayed on-screen using blue and green arrows, respectively.
95</p>
96
97<h3>DPD ON/OFF</h3>
98<p>
99The DPD feature can be turned on by pressing the 1 Button on the Wii Remote and turned off by pressing the 2 Button.
100</p>
101
102<h3>Aiming Mode ON/OFF</h3>
103<p>
104Pressing HOME on the Wii Remote can switch the Aiming mode using the <a href="../KPADEnableAimingMode.html">KPADEnableAimingMode</a> and <a href="../KPADDisableAimingMode.html">KPADDisableAimingMode</a> functions.
105</p>
106
107<h3>Source Code Files</h3>
108<TABLE border="1" cellpadding="3" cellspacing="0.1">
109  <TBODY>
110    <TR>
111<TD><code>main.h</code>, <code>main.c</code></TD>
112<TD>Contains the application startup and framework source. Controller initialization and loading are performed in these files.</TD>
113    </TR>
114    <TR>
115<TD><code>sample.h</code>, <code>sample.c</code></TD>
116<TD>This application performs a variety of operations with the controller values. Contains the source for CPU and drawing processes performed in each frame.</TD>
117    </TR>
118    <TR>
119<TD><code>graphic.h</code>, <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>, <code>kfont.c</code></TD>
124<TD>The collection of subroutines that displays text and values onscreen.</TD>
125    </TR>
126  </TBODY>
127</TABLE>
128
129<h2>See Also</h2>
130
131<H2>Revision History</H2>
132<P>
1332006/03/01 Initial version. <BR>2006/06/19 Changed tentative product name to official name.<BR>2006/08/30 Added information about the operation of the Nunchuk and Classic Controller.<br>2006/08/30 Added information about the ON/OFF operation of the DPD function.<br>2006/09/07 Added information about turning Aiming mode ON/OFF.<br> 2006/10/25 Changed the name from Revolution SDK 2.3 to KPADOld library.<br>
134</P>
135
136<hr>
137<P>CONFIDENTIAL</p>
138</BODY>
139</HTML>