3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

virtual graffiti

Step 6Computer setup: processing and the wiimote

computer setup: processing and the wiimote
Our main here is getting processing talking to the wiimote.

These instructions are Linux specific, but it should all work on a mac and windows with some research on how to get the wiimote's data into processing.

After installing processing, I found some instructions on the forum, but I still had some problems. Here is what I had to do:
  1. install processing
  2. install bluez libraries: sudo apt-get install bluez-utils libbluetooth-dev
  3. create ./processing/libraries/Loc and ./processing/libraries/wrj4P5
  4. download bluecove-2.1.0.jar and bluecove-gpl-2.1.0.jar and put into ./processing/libraries/wrj4P5/library/
  5. download wiiremoteJ v1.6, and put the .jar into ./processing/libraries/wrj4P5/library/
  6. download wrj4P5.jar (I used alpha-11) and put into ./processing/libraries/wrj4P5/library/
  7. download wrj4P5.zip and unzip into ./processing/libraries/wrj4P5/lll/
  8. download Loc.jar (I used beta-5) and put into ./processing/libraries/Loc/library/
  9. download Loc.zip and unzip into ./processing/libraries/Loc/lll/

Then I used code inspired from Classiclll to get the buttons and sensor bar working. The attached code/sketch just draws a circle where the 1st infra red source is found by the wiimote.

To check your bluetooth, press buttons one and two on the wiimote, then try

$ hcitool scan

at the terminal. You should see the nintendo wiimote detected. If you don't you'll need to look at your bluetooth setup further.

If it's all good, load the wiimote_sensor.pde (attached) program and start it. In the lower status part of the screen you should see:

BlueCove version 2.1.0 on bluez
trying to find a wii

Press buttons 1 and 2 on the wiimote. After it's detected, wave your infra red source (the spray can) around in front of it. You should see a red circle following your movement!

Make sure this works before moving on. If you can't get it to work, search the processing forum.

« Previous StepDownload PDFView All StepsNext Step »
2 comments
Jan 18, 2012. 1:46 PMSeeDoubleYouNL says:
Hey Matthew, thanks for you work. I tried your steps but when I run wiimote_sensor.pde processing gives me the following error:

Native Library bluecove not available
!! There may be no USB dongle/device. !!
java.lang.IllegalStateException: Bluetooth failed to initialize. There is probably a problem with your local Bluetooth stack or API.
at wiiremotej.WiiRemoteJ.(WiiRemoteJ.java:74)
at lll.wrj4P5.Wrj4P5.connect(Wrj4P5.java:301)
at lll.wrj4P5.Wrj4P5.connect(Wrj4P5.java:290)
at lll.wrj4P5.Wrj4P5.connect(Wrj4P5.java:284)
at lll.wrj4P5.Wrj4P5.connect(Wrj4P5.java:278)
at wiimotetest.setup(wiimotetest.java:30)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.bluetooth.BluetoothStateException: BlueCove library bluecove not available
at com.intel.bluetooth.BlueCoveImpl.loadNativeLibraries(BlueCoveImpl.java:381)
at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:429)
at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:65)
at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1020)
at java.security.AccessController.doPrivileged(Native Method)
at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1018)
at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1011)
at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
at wiiremotej.WiiRemoteJ.(WiiRemoteJ.java:67)
... 8 more

When I run $ hcitool scan it dows see the wiimote so the dongle is probably not the problem. Any suggestions?

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
23
Followers
8
Author:matthewvenn
I'm an artist/engineer excited about making cool stuff!