Java library for Wii peripherals

The majority of the information used to generate this library comes from the Wii-brew website, and specifically these three pages:

Currently my library is based around the bluecove interface for accessing the bluetooth hardware:

In order for bluecove to compile under eclipse for 64-bit systems requires the following flag passed to the JVM:

<jvmarg value="-d32"/>

The standard bluecove library does not work with 64-bit Matlab, in order to get this to work requires downloading the snapshot #63:

In order to get the library to work with Matlab requires a few adjustments.  To begin, exit Matlab if it is open.  Then open Matlab's static class path:


Add the path to the bluecove library bluecove-2.1.1-SNAPSHOT.jar to the end of classpath.txt. The path to the Processing files is most likely something like:


Now restart Matlab and add dynamic paths to the directories containing the java class code.  These must contain the full path to the class path including the root folder containing the package:

javaaddpath({ ...
   '/Users/bingjeff/Projects/WiiBalance/bin/', ...
   '/Users/bingjeff/Projects/WiiBalance/bin/wiibalance', ...
   '/Users/bingjeff/Projects/WiiBalance/bin/wiibalance/devices' ...
   '/Users/bingjeff/Projects/WiiBalance/bin/wiibalance/gui' ...

To test if the bluecove library is reachable with Matlab try the following commands:

import javax.bluetooth.*
o = LocalDevice.getLocalDevice();

A very basic script for reading data from Matlab using the Wii Library is then done by running the following example m-file:

% Create DataHandler object
oDataHand = wiibalance.gui.DataHandler();

% Initialize DataHandler

% Get data from DataHandler

% Close connection to bluetooth

On Windows Vista/7 systems additional steps may be required. These include downloading a specially compiled library bluecove.dll and setting a system property.
  • Download the bluecove.dll
  • Save it in the appropriate system directory
  • In java code set the system property to widcomm:
    • System.setProperty("bluecove.stack", "widcomm");
Jeff Bingham,
Sep 8, 2011, 12:12 PM
Jeff Bingham,
Sep 8, 2011, 12:12 PM
Jeff Bingham,
Sep 8, 2011, 12:12 PM