Wiimote Control
This article is about one the worst kept secrets on the internet, how to control your PC with the Wii remote control. This might be old news to some, but it was definately news to me to find out how staight forward it actually is. With glovePIE the average web scripter (like me) can be up and running in no time.
For this you will need:
1 Wii remote (though you can actually use several),
Bluetooth (I bought a dongle in Aldi for £15),
PC and internet connection to download *free* software.
You can do alot with the pitch and roll functions, so no need for an IR bar to start with.
I’m currently invloved in a project building interfaces controlled by webcams. In an attempt to find a more stable approach, with higher definition and less effected by the surrounding environment and after seeing Johnny Lee Chungs amazing inventions , I thought I’d check out the Wii controller.
After a bit of digging I found the basic recipe (Wiili is a great resource). First you need a Bluetooth driver that can talk to the wiimote. It seems Blue Soliel is tried and tested so I downloaded the free trial version. Get it here
Then you need some way to actually connect what’s coming out of the wiimote to your application. The easy way on Windows is with glovePIE, a handy little application from Carl Kenner. Cheers Carl ;O)
With glovePIE you can map the Wiimote output to a built-in mouse, keyboard or joystick emulator. So any application that uses mouse and keyboard (and there’s a few of those around) should be controllable with the wiimote, though I wouldn’t suggest you try to use it to write a novel.
With some very simple commands you can take a parameter, say the pitch of the wii controller, and map it to the axis of the mouse.
mouse.x = wiimote.Pitch
Because the pitch is between +90 and -90 degrees and the mouse uses a 0 to 1 scale, you need to add a multiplier:
mouse.x = (wiimote.Pitch + 90) / 180
And that’s about as complex at it gets. I’ve tried adding smoothing algorithms and it’s just like working in Actionscript or javascript.
There are some sample scripts included with glovePIE and you can download all my scripts here: http://www.opensourcery.net/glovePIE/piescripts.zip
I’ve tried to comment them quite a bit so you can see what’s going on.
That should be enough to get started. I’ll post again when my NYKO bar arrives…
Ofcourse, when you’re overiding the mouse input it can be tricky to close the program again, I just use the keyboard and the task list, or the wiimote and a click on the mouse if I can control the cursor with the wiimote.
Try it, it’s great fun. Thanks to Carl Kenner for sharing his little creation.
For .NET developers there’s a C# class
For Unity programmers there’s also a plugin under development