This is a minor extension of a Matlab library originally by Aaron Striegel's group at Notre Dame. This version works with Matlab 2007a, but I haven't tested it on any other versions. The code also contains an updated (v1.6) version of the, very cool, WiiLib library and support for the balance board.
Code: WiiLab_2007aCompat.zip
Bug Fixes
- 2007a requires classes to be in separate @* folders
- 2007a doesn't like "catch ME", replaced with "catch"
- 2007a doesn't like boolean safearrays from the COM object, replaced with double safearrays (in WiiLAB C#)
- Todo: The wiimote class in WiiLib v1.6 doesn't include the Connected switch, set to always 1 for now
A rough guide…
The libraries treat the balance board, more or less, as an accessory to the wiimote - similar to the nunchuck. So you have to connect a wiimote to access the board. It's not as straight-foward to get it working as it should be, but for now you can record data by…
1. Connect balanceboard and wiimote
2. Run WiimoteTest.exe (source code at WiiLib, here's a binary)
3. In Matlab run…
global bb wm1;
bb = Wiimote();
bb.Connect(); % balance board
wm1 = Wiimote();
wm1.Connect(); % wiimote
4. To access the data I usually look at the COM object directly…
bb.wm.GetBalanceBoardSensorState(); % returns values for the 4 sensors (kg)
bb.wm.GetBalanceBoardCoGState(); % returns values for the center-of-pressure (x,y)
wm1.wm.GetIRState();
… the devices may be in the wrong order, as well. In which case you can use
global bb wm1;
wm1 = Wiimote();
wm1.Connect(); % wiimote
bb = Wiimote();
bb.Connect(); % balance board
Thanks to Francis Djian for that tip.
Links
Here's a list a few (cool) related projects…
- Johnny Lee's Projects
- A list of IR Tracking projects from Johnny Lee
- Wii Drum-High
- Swiitboard





