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=utf-8">
5<META http-equiv="Content-Style-Type" content="text/css">
6<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
7<title>KPADEXStatus</title>
8</head>
9
10<body>
11
12<h1>KPADEXStatus</h1>
13
14<H2>Syntax</H2>
15<dl><dd><pre class="construction">
16#include &lt;revolution/kpad.h&gt;
17
18typedef union KPADEXStatus{
19    struct {
20        Vec2    stick ;
21
22        Vec     acc ;
23        f32     acc_value ;
24        f32     acc_speed ;
25    } fs ;
26
27    struct {
28        u32     hold;
29        u32     trig;
30        u32     release;
31
32        Vec2    lstick;
33        Vec2    rstick;
34
35        f32     ltrigger;
36        f32     rtrigger;
37    } cl ;
38
39    struct {
40        double  tgc_weight ;
41        double  weight[ WPAD_PRESS_UNITS ] ;
42        double  weight_ave[ WPAD_PRESS_UNITS ] ;
43        s32     weight_err ;
44        s32     tgc_weight_err ;
45    } bl ;
46} KPADEXStatus ;
47</pre></dd></dl>
48
49<H2>Elements</H2>
50<TABLE class="arguments" border="1" >
51  <TBODY>
52    <tr>
53<TH>fs.stick</TH>
54<TD>Control stick data for the Nunchuk. A circular or a cross clamp of maximum 1.0f is applied.</TD>
55    </tr>
56    <tr>
57<TH>fs.acc</TH>
58<TD>Accelerometer data. Note the coordinate system. Unlike the WPAD library, when the Nunchuk is pointed toward the TV screen, forward is Z+, upward is Y+, and rightward is X+.</TD>
59    </tr>
60    <tr>
61<TH>fs.acc_value</TH>
62<TD>Acceleration magnitude (length along the x-, y-, and z-axes).</TD>
63    </tr>
64    <tr>
65<TH>fs.acc_speed</TH>
66<TD>Change in acceleration (difference in length along the x-, y-, and z-axes relative to the previous values).</TD>
67    </tr>
68    <tr>
69<TH>cl.hold</TH>
70<TD>The flag is enabled while a Classic Controller button is pressed.</TD>
71    </tr>
72    <tr>
73<TH>cl.trig</TH>
74<TD>The flag is enabled only for the instant a Classic Controller button is pressed.</TD>
75    </tr>
76    <tr>
77<TH>cl.release</TH>
78<TD>The flag is enabled only for the instant a Classic Controller button is let go.</TD>
79    </tr>
80    <tr>
81<TH>cl.lstick</TH>
82<TD>Information related to the  Classic Controller's L Stick. A circular or cross clamp of maximum 1.0f is applied.</TD>
83    </tr>
84    <tr>
85<TH>cl.rstick</TH>
86<TD>Information related to the Classic Controller's R Stick. A circular or cross clamp of maximum 1.0f is applied.</TD>
87    </tr>
88    <tr>
89<TH>cl.ltrigger</TH>
90<TD>Information related to the L Button of the Classic Controller (where 0.0f &#x2266; <SPAN class="argument">ltrigger</SPAN> &#x2266; 1.0f). <font color="red">Zero is always returned, effective from SDK 3.3.</font></TD>
91    </tr>
92    <tr>
93<TH>cl.rtrigger</TH>
94<TD>Information related to the R Button of the Classic Controller (where 0.0f &#x2266; <SPAN class="argument">rtrigger</SPAN> &#x2266; 1.0f). <font color="red">Zero is always returned, effective from SDK 3.3.</font></TD>
95    </tr>
96    <tr>
97<TH>bl.tgc_weight</TH>
98<TD>The most recent average weight applied to the entire Wii Balance Board over approximately 2 seconds, with temperature and gravity corrections calculated. This is the true load applied to the Wii Balance Board.</TD>
99    </tr>
100    <tr>
101<TH>bl.weight</TH>
102<TD>Sensor values for each of the four corners of the Wii Balance Board, converted into weights.</TD>
103    </tr>
104    <tr>
105<TH>bl.weight_ave</TH>
106<TD>Average value calculated continuously over approximately 2 seconds' worth of samples of the body weight values calculated at each of the four corners of the Wii Balance Board. </TD>
107    </tr>
108    <tr>
109<TH>bl.weight_err</TH>
110<TD>Error code related to <code>bl.weight</code>, the sensor value obtained from the Wii Balance Board.</TD>
111    </tr>
112    <tr>
113<TH>bl.tgc_weight_err</TH>
114<TD>Error code related to <code>bl.tgc_weight</code>. The value is the most recent average weight applied to the entire Wii Balance Board over approximately 2 seconds, with temperature and gravity corrections calculated.</TD>
115    </tr>
116  </TBODY>
117</TABLE>
118
119<h2>Description</h2>
120<p>
121This union stores information from the external extension controller (Nunchuk and Classic Controller) separate from the Wii Remote. When the programmer accesses the <SPAN class="argument">ex_status</SPAN> member of the <a href="KPADStatus.html"><code>KPADStatus</code></a> structure, that access must be performed according to the values of <font color="#ff0000">error status (<SPAN class="argument">wpad_err</SPAN>), controller type (<SPAN class="argument">dev_type</SPAN>), and data format (<SPAN class="argument">data_format</SPAN>).</font>
122</p>
123
124<ul>
125<li>Button Input</li>
126</ul>
127<blockquote>
128Input from the Classic Controller buttons is defined using the following macro constants:
129<TABLE class="arguments" border="1" >
130<TR><TH> KPAD_CL_BUTTON_UP</TH>   <TD>+Control Pad UP is being pressed.</TD></TR>
131<TR><TH> KPAD_CL_BUTTON_DOWN</TH> <TD>+Control Pad DOWN is being pressed.</TD></TR>
132<TR><TH> KPAD_CL_BUTTON_LEFT</TH> <TD>+Control Pad LEFT is being pressed.</TD></TR>
133<TR><TH> KPAD_CL_BUTTON_RIGHT</TH><TD>+Control Pad RIGHT is being pressed.</TD></TR>
134<TR><TH> KPAD_CL_BUTTON_A</TH>    <TD>A Button is being pressed.</TD></TR>
135<TR><TH> KPAD_CL_BUTTON_B</TH>    <TD>B Button is being pressed.</TD></TR>
136<TR><TH> KPAD_CL_BUTTON_X</TH>    <TD>X Button is being pressed.</TD></TR>
137<TR><TH> KPAD_CL_BUTTON_Y</TH>    <TD>Y Button is being pressed.</TD></TR>
138<TR><TH> KPAD_CL_BUTTON_PLUS</TH> <TD>+/START Button is being pressed.</TD></TR>
139<TR><TH> KPAD_CL_BUTTON_HOME</TH> <TD>HOME is being pressed.</TD></TR>
140<TR><TH> KPAD_CL_BUTTON_MINUS</TH><TD>-/SELECT Button is being pressed.</TD></TR>
141<TR><TH> KPAD_CL_TRIGGER_L</TH>   <TD>L Button is being pressed.</TD></TR>
142<TR><TH> KPAD_CL_TRIGGER_R</TH>   <TD>R Button is being pressed.</TD></TR>
143<TR><TH> KPAD_CL_TRIGGER_ZL</TH>  <TD>ZL Button is being pressed.</TD></TR>
144<TR><TH> KPAD_CL_TRIGGER_ZR</TH>  <TD>ZR Button is being pressed.</TD></TR>
145</table>
146</blockquote>
147
148<ul>
149<li>Wii Balance Board Error Codes</li>
150</ul>
151<blockquote>
152The error codes related to Wii Balance Board sensor values are defined by the following macro definitions.
153<TABLE class="arguments" border="1" >
154<TR><TH> KPAD_WBC_ERR_EXIST</TH><TD>A load of 7 kg or more has been placed on the Wii Balance Board.</TD></TR>
155<TR><TH> KPAD_WBC_ERR_NONE</TH><TD>A load of 7 kg or more has not been placed on the Wii Balance Board.</TD></TR>
156<TR><TH> KPAD_WBC_ERR_NO_BATTERY</TH><TD>The Wii Balance Board has no remaining battery life and the sensors are not operational.</TD></TR>
157<TR><TH> KPAD_WBC_ERR_SETUP</TH><TD>The calibration of the Wii Balance Board is not completed.</TD></TR>
158<TR><TH> KPAD_WBC_ERR_WRONG_TEMP</TH><TD>This error code is not set any more.</TD></TR>
159<TR><TH> KPAD_WBC_ERR_WRONG_ZERO</TH><TD>A load was placed on the Wii Balance Board while the zero point was being set, so the zero-point setting has failed. Call the <a href="./KPADResetWbcZeroPoint.html"><CODE>KPADResetWbcZeroPoint</CODE></a> function and reset the zero point for the Wii Balance Board.</TD></TR>
160<TR><TH> KPAD_WBC_ERR_WEIGHT_OVER</TH><TD>A load of  more than 150 kg has been placed on the Wii Balance Board.</TD></TR>
161<TR><TH> KPAD_WBC_ERR_CALIBRATION</TH><TD>Wii Balance Board calibration has failed three times.</TD></TR>
162<TR><TH> KPAD_WBC_ERR_NO_ZEROPOINT</TH><TD>The Wii Balance Board zero point is not set. Call the <a href="./KPADResetWbcZeroPoint.html"><CODE>KPADResetWbcZeroPoint</CODE></a> function and set the zero point for the Wii Balance Board.</TD></TR>
163<TR><TH> KPAD_WBC_ERR_ZEROPOINT</TH><TD>The Wii Balance Board zero point is in the process of being set.</TD></TR>
164</table>
165</blockquote>
166
167<blockquote>
168The following macro constants define the error codes related to the most recent average weight applied to the entire Wii Balance Board over approximately 2 seconds, with temperature and gravity corrections calculated.
169<TABLE class="arguments" border="1" >
170<TR><TH> KPAD_WBC_ERR_TGC_READY</TH><TD>Ready to accurately measure the correct load.</TD></TR>
171<TR><TH> KPAD_WBC_ERR_TGC_NONE</TH><TD>Measurement of the load is complete. The accurate value for the correct load is stored in <CODE>bl.tgc_weight</CODE>.</TD></TR>
172<TR><TH> KPAD_WBC_ERR_TGC_UNSTABLE</TH><TD>An object is on the Wii Balance Board and it is ready to make an accurate measurement, but more than 10 seconds passed and the board failed to make an accurate weight measurement. The value of <code>bl.tgc_weight</code> is indefinite.</TD></TR>
173<TR><TH> KPAD_WBC_ERR_TGC_UNKNOWN</TH><TD>The state before accurately measuring the correct load. The value of <code>bl.tgc_weight</code> is indefinite.</TD></TR>
174<TR><TH> KPAD_WBC_ERR_TGC_TIMEOUT</TH><TD>The Wii Balance Board is ready to make an accurate measurement, but more than 10 seconds have passed and still no load has been placed on the device. The value of <code>bl.tgc_weight</code> is indefinite.</TD></TR>
175<TR><TH> KPAD_WBC_ERR_TGC_BUSY</TH><TD>The load is being measured. The value of <code>bl.tgc_weight</code> is indefinite.</TD></TR>
176</table>
177</blockquote>
178
179<H2>See Also</H2>
180<p class="reference">
181<a href="./KPADStatus.html">KPADStatus</a>
182</p>
183
184<H2>Revision History</H2>
185<P>
1862010/04/29 Revised the description of the Wii Balance Board error codes.<br>2009/06/23 Revised the explanations for <code>cl.ltrigger</code> and  <CODE>cl.rtrigger</CODE>.<br>2009/03/18 Revised the explanation for the Wii Balance Board structure members, <CODE>bl.tgc_weight</CODE> and <CODE>bl.tgc_weight_err</CODE>. Added the Wii Balance Board error codes.<br>2008/12/12 Changed a structure member for the Wii Balance Board. Revised <B>Description</B> regarding <code>bl.weight_ave</code>.<br>2008/04/30 Added descriptions related to the Wii Balance Board.<br>2006/10/25 Revised the description to match KPAD version 2.<br>2006/06/19 Changed the product name from tentative to official. Added information about unsupported member variables.<br>2006/03/01 Initial version.
187</P>
188
189<hr><p>CONFIDENTIAL</p></body>
190</HTML>
191