How to connect a Wiimote to a Computer

This document was written by Dynamic and can be found here:
http://www.hackforums.net/showthread.php?tid=78172


(I still advise you to register, go to the original site and find much much more.)
I've tried it, it worked, lost password, had to register again, lost user name and password, had to register again, then saved it, lost it again ... so here it is, hope I will not lose it again ... So here we go:

In this tutorial you will learn how to connect your wii remote to your computer, how to get your computer to recognise it and then how to use your wii remote to control aspects of your computer.

Requirements:
A bluetooth adapter or bluetooth enabled computer
A Nintendo Wii Remote
A brain that has the ability to follow instructions

Contents:
Section One - Getting the hardware and software
Section Two - Connecting your wii remote
Section Three - Executing simple scripts to test the connection

1. Section One - Getting The Hardware & Software

In this section you will gather all the hardware you need (if any) and install all the software you need for the easiest and most straight forward setup.

You will first of all need to check if your computer has bluetooth built into it, many don't, check the specs on your computer somehow; either have a look at the box it came in or have a look on the internet and it will tell you if it has bluetooth interregated.

If it doesn't your going to have to purchase a bluetooth adapter so your computer can use bluetooth. Don't worry these are fairly cheap and easy to come across, you can go to your local computer shop and find a range of them to choose from or you could stay in your house and wait a few days and order one off http://www.ebay.co.uk

The bluetooth adapter doesn't have to be anything special, i personally use the "NANO TINY USB 2.0 BLUETOOTH ADAPTER" off ebay which cost me a massive £3.00.

Next you need to get your software, your going to need some sort of program to manage your bluetooth conenctions; "BlueSoleil" is perfect for this. You can download the limited version off the offical site (links below) or you can download a version with keys so you can register it (links below) however you don't need the registered version for this tutorial.

Official Site Download
Torrent Link

After you have downloaded it, unzip it, then just follow the install instructions. You will have to reboot your computer after the install.

Next you will have to download "GlovePie" this program allows you to execute scripts that interperet what you are doing on the wii remote and link them to do something on the computer.

Glove Pie Official Site

First of all download it from one of the links below.
http://rapidshare.com/files/10075866/GlovePIE029.zip
http://flightpad.net/files/GlovePIE029.zip

Next unzip it, then to run the program you just run "GlovePIE.exe" no need to install anything.

2. Section Two - Connecting Your Wii Remote

Now were going to learn how to connect your wii remote to your computer and set it up as a human interface device. First of all make sure BlueSoleil is running in the taskbar it should look like this:

Next you want to right click on the icon and click "Display Classic View"

It should now look like this:


Now were goin to get our Wii Remote ready, take the back off of it so that the little red sync button is clearly visible and accesable. Were going to hold the sync button while searching for devices using BlueSoleil.

So while holding the sync button right click the big orange button on BlueSoleil and click "Search For Devices". A new device should be found, now right click on the middle button again and click "Stop Searching". Now once again hold the sync button and then double click the device icon in BlueSoleil, double click the highlighted icon below:

After you have double clicked the Wii device icon it will show you the device services available, the human interface device should now be lit as its available to connect as. So hold the sync button again and right click on the device icon and click "Connect as human interface device". Once it has establised a connection it should look like this:

You will now notice you don't need to hold the sync button anymore and the lights on your wii remote are continously flashing, this is a sign that it is now connected to your computer and you are now ready to launch some scripts.

3. Section Three - Executing Simple Scripts To Test The Connection

Now your ready to execute some simple scripts, make sure your wii remote is connected to your computer and the LED's are flashing. Now open up GlovePIE and copy and paste this into it (just like using notepad)

if wiimote.Up
  wiimote.Rumble = 1
endif
if wiimote.Down
  wiimote.Rumble = 0
endif

if wiimote.Up - states that if the user clicks up on the wiimote then it performs the next bit of code which is

wiimote.Rumble = 1 which makes the wii remote rumble. It then states that if the user clicks down on the wiimote it stops rumbling.

Just copy and past the code in and click run, then click up on your wii remote and if your remote starts to vibrate you know that it is setup properly. Click down to stop the vibrating.

The things you can do are infinite really, just like any other coding languages. Theres a link below to some of the documentation on the scripting in GlovePIE and how to use it:

http://www.wiili.org/index.php/GlovePie_Scripting

GlovePIE also comes with lots of example scripts for you to use.


I think that's basically it, if people like this tutorial I might make some more advanced ones to do with what you can do once you've got your wii remote connected.

I wrote this tutorial entirely myself, took me about an hourish of none stop hard work so if you read it please post whether it was usefull or not. Sorry for any spelling or grammar mistakes.

Dynamic.



Index | Site Map | Articles | NXT Building Instructions | How to use a Wiimote to control a Lego Mindstorms NXT |

Visit Legoland today!

EUR 118

one night
Hotel Legoland puts you only 1.5 minutes from Convention Centre / Trade Fair in Central, Billund, making...
More Information>>