1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<meta name="GENERATOR" content="Microsoft FrontPage 3.0"> 7<meta http-equiv="Content-Style-Type" content="text/css"> 8<link rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9<title>WBCSetZEROPoint</title> 10</head> 11 12<body> 13 14<h1 align="left">WBCSetZEROPoint</h1> 15 16<h2>Syntax</h2> 17 18<dl> 19 <dd><pre><code>#include <revolution/wbc.h></code> 20 21#define WBC_ERR_NONE 0 22#define WBC_ERR_NO_CONTROLLER -1 23#define WBC_ERR_BUSY -2 24#define WBC_ERR_WRONG_TEMP -3 25#define WBC_ERR_WRONG_PARAM -4 26</pre></dd> 27 <dd><pre>s32 WBCSetZEROPoint(double press_ave[], u32 size );</pre> 28 </dd> 29</dl> 30 31<h2>Arguments</h2> 32 33<table border="1" class="arguments"> 34 <tr> 35<th>press_ave[]</th> 36<td>Specifies the <CODE><EM><STRONG>press</STRONG></EM></CODE> values contained in the <CODE>WPADBLStatus</CODE> structure passed from <CODE>WPADRead</CODE>. Pass the two-second average values. </td> 37 </tr> 38 <tr> 39<th>size</th> 40<td>Specifies the size of <CODE><STRONG><EM>press_ave</EM></STRONG></CODE>. Allocate <CODE>WPAD_PRESS_UNITS</CODE> number of elements (4 elements).</td> 41 </tr> 42</table> 43 44 45<h2>Return Values</h2> 46<p> 47Returns 0 for success. Returns the following error codes on failure. 48</p> 49<table class="arguments" border="1"> 50 <tr> 51<th>WBC_ERR_BUSY</th> 52<td>Wii Balance Board calibration values have not yet been obtained.</td> 53 </tr> 54 <tr> 55<th>WBC_ERR_WRONG_PARAM</th> 56<td>Incorrect argument.</td> 57 </tr> 58</table> 59 60<h2>Description</h2> 61<p> 62This function sets the zero point. As arguments, pass the two-second averages of the <CODE><EM><STRONG>press</STRONG></EM></CODE> values (WBC raw values) in the no-load state. The zero point must be set using this function every time before measuring a weight. <br>Before you begin sampling for the two-second average for each <CODE><EM><STRONG>press</STRONG></EM></CODE> value, use the temperature update command (<code><a href="../wpad/WPADControlBLC.html">WPADControlBLC</a></code>) to update the Wii Balance Board's temperature information. 63 64After the temperature is updated, confirm that it was updated correctly. 65 66<font color="#FF0000"><u><strong>On very rare occasions a value of -128 or 127 is returned for temperature. If that happens, execute the temperature update command again.</strong></u></font> 67 68On very rare occasions, the Wii Balance Board <CODE><EM><STRONG>press</STRONG></EM></CODE> values can fluctuate wildly for a short period after a command is sent.<font color="#FF0000"><u><strong>Therefore, after issuing the temperature update command, wait a short time (roughly 200ms) before getting the <CODE><EM><STRONG>press</STRONG></EM></CODE> values.</strong></u></font> <br> <br>You must execute <code><a href="WBCSetupCalibration.html">WBCSetupCalibration</a></code> prior to using this function. 69</p> 70 71 72<h2>See Also</h2> 73<p class="reference"> 74<a href="../wpad/WPADControlBLC.html">WPADControlBLC</a>, 75<a href="WBCSetupCalibration.html">WBCSetupCalibration</a> 76</p> 77 78<h2>Revision History</h2> 79<p> 802008/04/17 Added error codes.<br>2007/09/28 Corrected typos.<br>2007/09/13 Deleted the description concerning the temperature update feature.<br>2007/09/10 Changed the function format.<br>2007/08/31 Initial version. 81</p> 82<hr><p>CONFIDENTIAL</p></body> 83</html> 84