Description

WiiNode is a library for connecting your WiiMote to PlotDevice. No actual Wii is needed, just the remote.

Download

download wiinode.zip (24KB)
Last updated for NodeBox 1.9.4
Licensed under the GPL
Author: Frederik De Bleser

Documentation



Prerequisites

OSCulator makes the connection with the WiiMote possible. The necessary configuration settings are in the wiidraw.zip file under settings.oscd.

The program needs to be running in the background, and communicates over OSC.

Getting your WiiMote to work with the program, for me, meant pushing the buttons ‘1’ and ‘2’, or alternatively, the red SYNC button (under the battery cover), a few times. Once you get a battery reading, you should be fine.


How to get the library up and running

Put the web library folder in the same folder as your script so PlotDevice can find the library. You can also put it in ~/Library/Application Support/PlotDevice/.

wiinode = ximport("wiinode")

Outside of PlotDevice you can also just do import wiinode.


Setting up the main loop

In your animation, initialize the WiiMote object. Then, in each frame, call the update method:

def setup():    global wm    wm = wiinode.WiiMote()def draw():    global wm    wm.update()    print wm.yaw

The WiiMote class

To get a good overview of all the values, check out wiinode_example3.py, which visualizes all available WiiMote attributes.

Rotation

The WiiMote returns roll, pitch and yaw. See the Wikipedia article on flight dynamics for more information.

See the wiinode_example1.py for a game that uses the roll value.

wm.pitch # The absolute pitch valuewm.roll # The absolute roll valuewm.yaw # The absolute yaw value

Acceleration

The WiiMote returns acceleration in both x, y and z positions. This is not the remote’s absolute position in space. You need an infrared sender for that.

wm.x # The horizontal (left-right) accelerationwm.y # The forward accelerationwm.z # The vertical (up-down) acceleration

Buttons

The WiiMote’s A and B buttons can be monitored as well.

wm.a # True if the A button is pressedwm.b # True if the B button is pressed

Show me someone fooling around with this