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>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 <revolution/kpad.h> 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 } bl ; 45} KPADEXStatus ; 46</pre></dd></dl> 47 48<H2>Elements</H2> 49<TABLE class="arguments" border="1" > 50 <TBODY> 51 <tr> 52<TH>fs.stick</TH> 53<TD>Control stick data for the Nunchuk. A circular or a cross clamp of maximum 1.0f is applied.</TD> 54 </tr> 55 <tr> 56<TH>fs.acc</TH> 57<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> 58 </tr> 59 <tr> 60<TH>fs.acc_value</TH> 61<TD>Acceleration magnitude (length along the x-, y-, and z-axes).</TD> 62 </tr> 63 <tr> 64<TH>fs.acc_speed</TH> 65<TD>Change in acceleration (difference in length along the x-, y-, and z-axes relative to the previous values).</TD> 66 </tr> 67 <tr> 68<TH>cl.hold</TH> 69<TD>The flag is enabled while a Classic Controller button is pressed.</TD> 70 </tr> 71 <tr> 72<TH>cl.trig</TH> 73<TD>The flag is enabled only for the instant a Classic Controller button is pressed.</TD> 74 </tr> 75 <tr> 76<TH>cl.release</TH> 77<TD>The flag is enabled only for the instant a Classic Controller button is let go.</TD> 78 </tr> 79 <tr> 80<TH>cl.lstick</TH> 81<TD>Information related to the Classic Controller's L Stick. A circular or cross clamp of maximum 1.0f is applied.</TD> 82 </tr> 83 <tr> 84<TH>cl.rstick</TH> 85<TD>Information related to the Classic Controller's R Stick. A circular or cross clamp of maximum 1.0f is applied.</TD> 86 </tr> 87 <tr> 88<TH>cl.ltrigger</TH> 89<TD>Information related to the L Button of the Classic Controller (where 0.0f ≦ <SPAN class="argument">ltrigger</SPAN> ≦ 1.0f).</TD> 90 </tr> 91 <tr> 92<TH>cl.rtrigger</TH> 93<TD>Information related to the R Button of the Classic Controller (where 0.0f ≦ <SPAN class="argument">rtrigger</SPAN> ≦ 1.0f).</TD> 94 </tr> 95 <tr> 96<TH>bl.tgc_weight</TH> 97<TD>The most recent average weight applied to the entire Wii Balance Board over approximately 2 seconds, with temperature and gravity corrections calculated.</TD> 98 </tr> 99 <tr> 100<TH>bl.weight</TH> 101<TD>Sensor values for each of the four corners of the Wii Balance Board, converted into weights.</TD> 102 </tr> 103 <tr> 104<TH>bl.weight_ave</TH> 105<TD>Average values of the most recent weight for each corner of the Wii Balance Board over approximately 2 seconds.</TD> 106 </tr> 107 <tr> 108<TH>bl.weight_err</TH> 109<TD>Error code related to sensor values obtained from the Wii Balance Board.</TD> 110 </tr> 111 </TBODY> 112</TABLE> 113 114<h2>Description</h2> 115<p> 116This 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> 117</p> 118 119<ul> 120<li>Button Input</li> 121</ul> 122<blockquote> 123Input from the Classic Controller buttons is defined using the following macro constants: 124<TABLE class="arguments" border="1" > 125<TR><TH> KPAD_CL_BUTTON_UP</TH> <TD>+Control Pad UP is being pressed.</TD></TR> 126<TR><TH> KPAD_CL_BUTTON_DOWN</TH> <TD>+Control Pad DOWN is being pressed.</TD></TR> 127<TR><TH> KPAD_CL_BUTTON_LEFT</TH> <TD>+Control Pad LEFT is being pressed.</TD></TR> 128<TR><TH> KPAD_CL_BUTTON_RIGHT</TH><TD>+Control Pad RIGHT is being pressed.</TD></TR> 129<TR><TH> KPAD_CL_BUTTON_A</TH> <TD>A Button is being pressed.</TD></TR> 130<TR><TH> KPAD_CL_BUTTON_B</TH> <TD>B Button is being pressed.</TD></TR> 131<TR><TH> KPAD_CL_BUTTON_X</TH> <TD>X Button is being pressed.</TD></TR> 132<TR><TH> KPAD_CL_BUTTON_Y</TH> <TD>Y Button is being pressed.</TD></TR> 133<TR><TH> KPAD_CL_BUTTON_PLUS</TH> <TD>+/START Button is being pressed.</TD></TR> 134<TR><TH> KPAD_CL_BUTTON_HOME</TH> <TD>HOME is being pressed.</TD></TR> 135<TR><TH> KPAD_CL_BUTTON_MINUS</TH><TD>-/SELECT Button is being pressed.</TD></TR> 136<TR><TH> KPAD_CL_TRIGGER_L</TH> <TD>L Button is being pressed.</TD></TR> 137<TR><TH> KPAD_CL_TRIGGER_R</TH> <TD>R Button is being pressed.</TD></TR> 138<TR><TH> KPAD_CL_TRIGGER_ZL</TH> <TD>ZL Button is being pressed.</TD></TR> 139<TR><TH> KPAD_CL_TRIGGER_ZR</TH> <TD>ZR Button is being pressed.</TD></TR> 140</table> 141</blockquote> 142 143<ul> 144<li>Wii Balance Board Error Codes</li> 145</ul> 146<blockquote> 147The error codes related to Wii Balance Board sensor values are defined by the following macro definitions. 148<TABLE class="arguments" border="1" > 149<TR><TH> KPAD_WBC_ERR_EXIST</TH><TD>A mass of 7kg or greater has been placed on the Wii Balance Board.</TD></TR> 150<TR><TH> KPAD_WBC_ERR_NONE</TH><TD>A mass of 7 kilograms or greater has not been placed on the Wii Balance Board.</TD></TR> 151<TR><TH> KPAD_WBC_ERR_NO_BATTERY</TH><TD>The Wii Balance Board has no remaining battery life, and its sensors are not operational.</TD></TR> 152<TR><TH> KPAD_WBC_ERR_SETUP</TH><TD>Wii Balance Board calibration has not been completed.</TD></TR> 153<TR><TH> KPAD_WBC_ERR_WRONG_TEMP</TH><TD>Wii Balance Board temperature information is incorrect. Call the <a href="./KPADResetWbcZeroPoint.html"><CODE>KPADResetWbcZeroPoint</CODE></a> function to initialize the Wii Balance Board.</TD></TR> 154<TR><TH> KPAD_WBC_ERR_WRONG_ZERO</TH><TD>The zero point has not been correctly set for the Wii Balance Board. Call the <a href="./KPADResetWbcZeroPoint.html"><CODE>KPADResetWbcZeroPoint</CODE></a> function to initialize the Wii Balance Board.</TD></TR> 155</table> 156</blockquote> 157 158<H2>See Also</H2> 159<p class="reference"> 160<a href="./KPADStatus.html">KPADStatus</a> 161</p> 162 163<H2>Revision History</H2> 164<P> 1652008/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.<BR> 166</P> 167 168<hr><p>CONFIDENTIAL</p></body> 169</HTML> 170