Mindstorm Wiimote Controlled Car

Apr 14, 2011 by

We all have fun with the Wii, since the remote can be used to play many types of games. But can it control the Mindstorm NXT or NXT 2.0? Yes, by using DarwiinRemote on Mac or Glove Pie on PC, you can easily remote control your Lego Mindstorm NXT or NXT 2.0 with your Wii remote.

Select your operating system to get started:

PC or MAC

PC Instructions:

1. In order to connect your Wiimote to the computer please read the document below:

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.

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.

After you read the document above follow the steps below:

 

So if everything is ok your screen should look like this: wii

2. To connect the NXT go to bluetooth from the main menu and hit search. The NXT should find your computer. Once it does, select it, select a port, then search for bluetooth devices from your computer. The NXT will ask for a passcode, just put whatever you want, I used 1234. Put in the same code on the computer when it asks for it. The computer will now connect to the NXT.

In IVT BlueSoleil you have to right click the NXT after you found it and select pair.

wii

Now you have to connect it to the computer. Right click – select “Connect” and do not forget the comport used. If everything is ok it should look like this:

3. To use the Wiimote on your computer you need a program called glovepie. Actually you should’ve done this already.

To test you Wiimote you can use this program (this is the one used in the video):

wiimote.Leds = 9
Key.F1 = Wiimote1.Left
Key.F2 = Wiimote1.Right
Key.F3 = Wiimote1.Up
Key.F4 = Wiimote1.Down
Key.F5 = Wiimote1.A

glovepie

Once you have the code in press run. The wiimote should have 1st and 4th light up.

4. To connect the program to the NXT, you need a program called OnBrick. (Web site can be found here).
To make the connection between NXT and OnBrick go to the Comms tab and write the com port you used to connect the NXT to the computer. Press Open. If everything is ok when you press Beep … well you should hear a beep comming from the NXT brick. If not … something is wrong and you have to fix it 🙂

And now the fun part. I will show only how to configure the program for one motor, the rest is pretty the same. You will configure the function for the Wiimote left button. Go to RC tab.


Press the small yellow box bellow Fwd1. On your screen this is shown as ZigZag!!!!
You will go to a config dialog:

onbrick

Press Clear All. Enter the name (whatever you want). Next to the name field you can see F1. Remember this line from the code entered for Wiimote “Key.F1 = Wiimote1.Left” – this is what should happen when you press F1 or the left button on Wiimote.

Press the first blue arrow- forward 20 cm. You can leave this as it is. Press ok. Now if you press F1 the motors connected to B and C port should start for a short while. Now press the left button on Wiimote … If it’s not doing the same something is wrong.

Please remember that the NXT OnBrick should be the focused program!

The rest should be easy from now. Please do not forget to check the key for each option. For ex: Tune is for key F2 or the right arrow on wiimote.

 

MAC Instructions:

This a Mindstorm Wiimote Controlled Car.  Here are the following instructions you need to follow to build this robot.

1. You will need the Mindstorm software and DarwiinRemote .(This software is for Mac users.  You can find a PC version by searching on Google).

2. Launch Darwiin Remote and go on its preferences.  Click add and name it NXT and then click “ok” and click on “wiimote.”

3. Now you can configure the settings with this image:

Mindstorm WiiMote Controlled Car Information

 

4. Click “ok” and then click on find wiimote.  After connecting to your wiimote, launch the Mindstorm software.

5. Click on tools remote control to connect to your NXT.  Then push action five times.  Now you are ready to control your robot. (Note: After you click on action five times, don’t touch your computer.  If you do, click action five times again to fix the problem).

 

Related Posts

Tags

Share This

2 Comments

  1. James Bond

    mine, doesn't work, the light blinks and all, but when I try to run the program, the 1st and 4rth lights don't come on, it keeps on flashing

Leave a Reply

Your email address will not be published. Required fields are marked *