The Wii Fit (or Wii Fitness) Balance Board is a new Wii controller that you stand on. It has four weight/pressure sensors, one in each corner.
They haven’t been released in Australia yet, so this is untested, and based only on our translations of a Japanese website. GlovePIE’s Balance Board support probably doesn’t work.
It behaves like an extra dummy Wiimote with a Balance Board attachment plugged in. The dummy Wiimote’s LED1 controls the power LED on the top of the board, and the dummy Wiimote’s A button is actually the power button on the Balance Board. The other things on the dummy Wiimote do nothing, except the built-in balance board “attachment”.
You can read the raw values of the four sensors like this:
Different sensors vary quite a bit.
To read the weight from the sensors in kilograms, use this:
You can also use the Balance Board as a human joystick, like this:
They are values between -1 and 1 just like any other joystick.
There are some unknown values you can try:
You can set the LED like this:
Wiimote2.BalanceBoard.LED = true
You can read the button like this:
Low level stuff
You can read the data reports from the Wiimote with:
debug = Wiimote.InByteString
Or you can read them individually with:
var.a = Wiimote.InReport
var.b = Wiimote.InByte1
You can send data reports to the Wiimote with this function (it has no dot):
WiimoteSend(1, 0x12, 1, 0x33)
The first parameter of WiimoteSend is the Wiimote number you want to send it to, normally 1. The second parameter is the report number. The remaining parameters are the report payload. In this case, the report tells the Wiimote to start vibrating, and to send data via report 0x33.
The one-byte reports can also be sent another way by setting one of these values (it will only send the report when the value changes):
Wiimote.Report11, Wiimote.Report13, Wiimote.Report14, Wiimote.Report15, Wiimote.Report19, Wiimote.Report1A
You can set bytes in the Wiimote’s onboard memory (where Miis are stored) with the WiimotePoke command, and read bytes from its memory with the WiimotePeek command.
WiimotePoke(1, 0x04B00033, 0x33)
var.value = WiimotePeek(1, 0x04B00033)
The first parameter is optional, and it is the Wiimote number. The second parameter is the address. The third parameter is the value you want to set it to (between 0 and 255).
Note that the Nunchuk and Classic Controller have their own memory space which is mapped to the Wiimote’s when they are plugged in.
You can set the Channel with Wiimote.Channel. The Channel should be a hexadecimal number between 0x30 and 0x3F, which determines which information the Wiimote sends back to the computer.
Don’t use these low level functions unless you know what you are doing and have read the www.wiili.org/Wiimote page. One person has bricked their nunchuk by experimenting with writing to all its addresses (although that is how we discovered how the nunchuk works).
You can tell how many Wiimotes there are with Wiimote.Count
You can access a particular wiimote by putting a number after the word “wiimote” and before the dot. For example:
Enter = wiimote2.A
You can tell whether a particular Wiimote exists with Wiimote.Exists
You can’t read the Serial number (as text) anymore with Wiimote.Serial, because I disabled it. It rebooted computers with BlueSoleil when you tried to read the serial.
Don’t forget to sync both Wiimotes with the PC before you try to use them.
You can read the P5 Virtual Reality Glove values using either the “P5” object, or the “Glove” object. Using Glove is better if you want to put a number after it (“P52” would look silly).
The Virtual Reality glove has lots of different fields you can set, in four main categories: Buttons, Finger bends, Location, and Rotation.
The P5 Glove has 4 buttons on the back, labelled A, B, C, and D. The D button doubles as the Power button. You can only read the D button while the user is turning the glove on (while the user is turning the glove off, the D button is always false). If you want to use the D button, you need to tell the user to double click it, (to your script it will look like a single click).
You can read them like this:
debug = P5.A
They are either true or false.
If the glove is out of range, or switched off, or behind something, they will always be false.
The five fingers are called Thumb, Index, Middle, Ring and Pinky. They return a value between 0 and 63 (unless you assign them to something true or false, like a key, then they return true if >= 32).
0 means as straight as the maximum straightness for that finger during calibration.
63 means as bent as the maximum bent-ness during calibration.
You use them like this:
Enter = p5.Index > 32
Raw Finger Bends
If you want to know the raw bend sensor values, then you can get an approximate version by reading the values AbsoluteThumb, AbsoluteIndex, AbsoluteMiddle, AbsoluteRing, and AbsolutePinky. They are converted from the 0 to 63 values, so it won’t give you more precision, or tell you if it is outside the calibration range. But it will let you know what raw bend sensor value it corresponds to. The raw bend sensor values are backwards (small means bent) and may be roughly between 400 and 1000. These values are less useful than the ones above.
If you want to know what angles the bend values represent for the different finger joints, then you can use the ThumbProximal, ThumbMedial, ThumbDistal, IndexProximal, IndexMedial, IndexDistal, etc. values.
Proximal is the closest joint on your finger where it joins the hand, Medial is the middle one, and Distal is the finger tip joint. Note that the thumb’s proximal joint is actually INSIDE your hand.
These angles are only guesses, since the P5 only returns one value per finger between 0 and 63. They only work if you calibrate the glove to the range: fingers completely flat to fingers bent as much as possible.
Index Fingertip Position
You can find the position of the index finger tip by using the P5.IndexPos vector. It is measured in P5 Units (51.2ths of an inch, or half a mm) but you can convert it to whatever units you want. It is unfiltered, so you should use the Smooth function, preferably with a both an average and a deadband parameter. It is calculated based on the position of LED 4, and the joint angles above. It is not very reliable, it is more experimental.
You can recognize various hand-shapes in GlovePIE by using the 5 letter codes for fingers. Each letter corresponds to one finger, and can be either “l” (L) for straight, “r” for partly bent, “n” for completely bent, or “x” for “don’t care”. Note that the shape of the letter corresponds to the shape of the finger.
So for example, to find out if the user is pointing, use this:
debug = p5.xlnnn
The first letter x means don’t care about the thumb. The second letter (l) means the index finger must be straight. The third letter (n) means the middle finger must be completely bent, and the same for the last two fingers.
Note that the thumb comes first in these codes, even if it is your left hand.
You can use any five-letter combination of those letters.
It will be either true or false.
You can set the values of p5.maxl and p5.minn to values between 0 and 63 if you don’t like the default bend amounts that correspond to those three ranges.
Finger Velocity and Acceleration
I stupidly decided to use the absolute values for velocity and acceleration. So they will be in the opposite direction to what you expect, and have a different magnitude. Sorry.
They are FingerVelocity0, FingerVelocity1, FingerVelocity2, FingerVelocity3, and FingerVelocity4 for velocity, and FingerAcceleration0, etc. for acceleration.
These values probably need smoothing, or they aren’t very useful.
Values that have nothing to do with Finger Bends
Beware of values like ThumbUp or FingersForwards. They have absolutely nothing to do with the thumb or finger bends, and are actually about the glove’s ROTATION. They say what direction those parts WOULD be pointing IF they were not bent at all.