The WBC Library converts the raw values obtained using
WPADRead from the Wii Balance Board (
press values) into weight values.
The following include file is required.
The Wii Balance Board has four legs, with a balance sensor attached to each leg. When subjected to a load, they return a value proportional to the weight of the load. Specifically, the heavier the load, the larger the value returned.
Consider that this value itself has no meaning. It is the amount of change in this value that has meaning. In this context, the amount of change refers to the amount of change compared to the state when nothing is on the Wii Balance Board accessory (the no-load state). A method called zero point setting is required to recognize this no-load state. The balance of a person (or object) on the Wii Balance Board accessory is to be determined by observing the amount of change across the four balance sensors. The load, then, is the total value of the amount of change at the four balance sensors.
The console communicates wirelessly with the Wii Balance Board at 200 samples per second, the same as the Wii Remote. However, the Wii Balance Board's balance sensor values can change at a rate of only 60 samples per second.
The order of the
press values in the array obtained by
WPADRead corresponds to the Wii Balance Board's legs as shown below.
To use the Wii Balance Board, it must first be normal-paired with a console. Pair the Wii Balance Board by pressing the SYNC Button on the console and on the Wii Balance Board at the same time.
Only one console can be normal-paired with a Wii Balance Board. Use
WPADIsRegisteredBLC to check whether a Wii Balance Board has already been paired. If a paired Wii Balance Board is then paired with a different console, the Wii Balance Board's settings are overwritten and it will need to be normal-paired again.
This chapter describes basic programming used to control the Wii Balance Board accessory.
The Wii Balance Board accessory uses two libraries: the WPAD and the WBC. The WPAD library allows direct access to hardware, and its
WPADRead function is called to get raw output values from the balance sensors.
The WBC library is used to convert values obtained by
WPADRead into load values, in kilogram units. Therefore, it is positioned as a higher order library than the WPAD library. Because some functions must be directly controlled from the WPAD library, the library organization associated with the Wii Balance Board accessory is as shown below.
Basic library functions are provided below.
Create a conversion formula within the library, which will convert the readings to weights. Each Wii Balance Board stores unique calibration data, and the conversion formula uses that calibration data. By calling
WBCSetupCalibration, the calibration data will be loaded and the conversion formula will be created within the library.
WBCSetupCalibrationmay be executed only after the Wii Balance Board is paired. For more information, see the sample demo (
Control returns immediately after executing this function, but its actual processing continues for a short time (about 650ms) before completing. Use
WBCGetCalibrationStatus to determine whether this function has completed normally.
Setting the zero point is the act of setting the Wii Balance Board's unloaded state in the WBC Library.
s32 WBCSetZEROPoint(double press_ave[ ], u32 size);
press_ave argument, set the average value of all the
press values obtained by
WPADRead over a period of two seconds. Set
press_ave in the same order as the
press values. (For example, the average of
status.press should be inserted into
size, specify the number of elements in the
press_ave array. (Normally, allocate space for four elements.)
Before sampling for each
press value, use the temperature update command (
WPADControlBLC) to update the Wii Balance Board's temperature information.
After updating the temperature with the temperature update command (
WPADRead to confirm that the temperature 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. Therefore, after issuing the temperature update command, wait a short time (roughly 200 ms) before getting the
The readings are converted into weight values with the following function.
s32 WBCRead(WPADBLStatus *status, double weight[ ], u32 size);
WPADBLStatus structure, obtained with
WPADRead, as an argument. The converted weight values will be stored in
weight array in the same order as the array of
press values. In
size, specify the number of elements in the
weight array. (Normally, allocate space for four elements.)
The following function carries out both temperature correction and correction for gravitational acceleration.
s32 WBCGetTGCWeight(double total_weight_ave, double *tgc_weight, WPADBLStatus *status);
total_weight_ave argument, specify the average value obtained over a period of two seconds (120 samples) for the total of the weight values obtained by
WBCRead at four different points.
The balance sensors on each of the Wii Balance Board's four corners will cease to operate when the remaining battery life drops below a certain threshold. However, the wireless module will continue to operate even below the threshold, causing data to continue to be sent from the Wii Balance Board. All values of
press become zero at this time.
When the remaining battery life is below the threshold, the
WBCGetBatteryLevel function returns zero. Have your applications use this function to check the remaining battery life and prompt the user to replace the battery if zero is returned.
Balance sensors have the characteristic of not completely returning to their original state after a weight is applied and then subsequently reduced; that is, they exhibit hysteresis. For example, assume that the zero point has been set. A person (or object) gets onto and then off of the Wii Balance Board. Now, the state of the Wii Balance Board is not exactly the same as its state when the zero point was set.
In this way, the unloaded state of the balance sensors changes every time a person (or object) gets onto and off of the Board. For this reason, always set the zero point before making an accurate measurement.
The balance sensors are metallic (aluminum). The malleability of a metal changes with the temperature. Specifically, they are more malleable (easier to bend) at high temperatures and more stiff (difficult to bend) at low temperatures. More malleable balance sensors relay heavier weight values, and stiffer ones relay lighter values.
Weight changes in proportion to gravity. As a result, weight values must take gravitational acceleration into account. Gravitational acceleration differs slightly with latitude. Specifically, the earth's rotation applies the greatest centrifugal force to a latitude of zero (right on the equator), causing a smaller gravitational acceleration there. The end result is that weight values at the equator will be lighter, and weight values at the north and south poles will be heavier.
The following steps summarize the ideal process for making accurate measurements:
Games that support the Wii Balance Board accessory must implement a check of Wii Balance Board operations, which allows the user to verify that the Wii Balance Board is working normally. Because the purpose of this mode is to allow the user to troubleshoot voluntarily, implement a check of Wii Balance Board operations as a separate mode from the game.
Within the check of Wii Balance Board operations, check whether it is possible to get measurement values from each of the four sensors of the Wii Balance Board accessory. The board fails the check if a measurement value cannot be obtained from even one sensor.
WBCGetBatteryLevelfunction to check the battery level; if 0 is returned, prompt the user to replace the batteries.
WBCReadfunction. However, depending on how the Wii Balance Board was broken, the return value of the
WBCReadfunction may not be correct. For this reason, we recommend requiring the user to press a button after they have stepped off the Wii Balance Board, then checking the
WBCReadfunction’s return value. If
WBCReadreturns a value of 1 at this time, there is a possibility that the Wii Balance Board is malfunctioning. In this case, treat it as a malfunctioning Wii Balance Board.
2013/05/08 Automated cleanup pass.
2012/07/25 Cleanup pass
2011/07/20 Initial Version