#include <cafe/pads/wbc/wbc.h>

#define WBC_ERR_NONE             0
#define WBC_ERR_BUSY            -2
#define WBC_ERR_WRONG_TEMP      -3
#define WBC_ERR_WRONG_PARAM     -4

s32 WBCSetZEROPoint(double press_ave[ ], u32 size );


press_ave[ ] Specifies the press values contained in the WPADBLStatus structure passed from WPADRead. Pass the two-second average values.
size Specifies the size of press_ave. Allocate WPAD_PRESS_UNITS number of elements (4 elements).

Return Values

Returns 0 for success. Returns the following error codes on failure.

WBC_ERR_BUSY Wii Balance Board calibration values have not yet been obtained.
WBC_ERR_WRONG_PARAM Incorrect argument.


This function sets the zero point. As arguments, pass the two-second averages of the press values (WBC raw values) in the no-load state. The zero point must be set using this function every time before measuring a weight.

Before you begin sampling for the two-second average for each press value, use the temperature update command (WPADControlBLC) to update the Wii Balance Board's temperature information.

After the temperature is updated, confirm that it was updated correctly. On rare occasions a value of -128 or 127 is returned for the temperature. If that happens, execute the temperature update command again.

On rare occasions, the Wii Balance Board press values can fluctuate wildly for a short period after a command is sent. After issuing the temperature update command, wait a short time (roughly 200ms) before getting the press values.

Run WBCSetupCalibration prior to using this function.

Do Not Call From

Background Do not call this function from the background.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.
Multiple Cores Do not call this function from more than one Core.

See Also


Revision History

2013/05/08 Automated cleanup pass.
2011/07/20 Initial version.