How to use a Wiimote to control a Lego Mindstorms NXT

This document was written based on this video so the user jaredb93max has all the credits. Nice video, but next time please use a tripod :)

1. In order to connect your Wiimote to the computer please use this document:
http://www.hackforums.net/showthread.php?tid=78172
or
connect_wii_mote_to_computer.html

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

Please ignore my 2 stupid phone trying to connect to computer. Also ignore NXT for now.

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.

Good luck! If you have any questions please do not hesitate to contact me.

PS: This web site is not about robotics, this is a new hobby and this is the first document. Maybe other docs will come soon, maybe not ... I don't know :)



Index | Site Map | Articles | NXT Building Instructions |


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>>