WII NUNCHUCK projects with Arduino Leonardo AVR-T32U4



WII NUNCHUCK is low cost joystick and 3 axes accelerometer combo which could be read by I2C.

We created UEXT plug-in board which allow WII-NUNCHUCK to be used with any of our development boards with UEXT connector.

Here on this video: http://www.youtube.com/watch?v=fXa6AA9Aq_o

you can see four projects made with WII-NUNCHUCK

1. Mouse – you can move the mouse pointer with Joystick and to use the two buttons as mouse buttons

2. Sound – with the 3 axes accelerometer you can change the pitch of the generated tone

3. Driving two servos with the 3-axes accelerometer

4. Drivinig RGB stripe with MOD-RGB and MOD-WII-NUNCHUCK – as AVR-T32U4 have just one UEXT port we use the UEXTx5 extender.

The demo code is at GitHub: https://github.com/OLIMEX/DUINO/tree/master/AVR/WII-NUNCHUCK

AVR-T32U4 ARDUINO demo code for MOD-WII-NUNCHUCK interfacing


Wii-Nunchuck is low cost combo of 3 axes accelerometer, 2 axes Joystick and 2 buttons. It communicated via I2C and we made UEXT connector for it so it plugs directly to AVR-T32U4 Arduino compatible breadboard.

The Arduino library is available at: https://github.com/OLIMEX/DUINO/tree/master/AVR/WII-NUNCHUCK with demo code which prints accelerometer, joystick and button status: http://www.youtube.com/watch?v=fodnHXkwpHg

iMX233-OLinuXino I2C tutorial – using WII NUNCHUK


In this post I will show you how you can access I2C devices with iMX233-OLinuXino and how to read WII-NUNCHUCK info.

WII is popular game console, the NUNCHUCK accessory contain two buttons, accelerometer and joystick combo, as it’s mass produced the price is incredible low. You can read more about it at Wikipedia http://en.wikipedia.org/wiki/Wii_Remote

Olimex offers MOD-WII-UEXT-NUNCHUCK which contains WII-NUNCHUCK coupled to UEXT connector, so you can directly connect it to any of our boards with UEXT connector like our Arduino, Pinguino, Maple, Energia etc boards and of course iMX233/A13-OLinuXino.

Before you start working with I2C you have to check if your iMX233-OLinuXino board is with UEXT connected to the hardware I2C ports.

Why? When we designed the iMX233 we wanted to keep the LCD port complete and the hardware I2C was multiplexed with the LCD ports.
So we put triple jumper on UEXT I2C signals which cold be soldered to software and hardware I2C ports. By default we made them to the software I2C.

Later we found that software defined I2C is bad idea on RTOS as on heavy load I2C may not timing correctly and that it’s recommended to use just the hardware I2C so from the beginning of September we soart producing iMX233-OLinuXino with jumpers wired to the hardware I2C.

As there are still many iMX233 on stock at our distributors we described in the user manual how one could do this himself.

So to work with the code below you should make sure your iMX233-OLinuXino have wired hardware I2C to UEXT.

Download the code from GitHub https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/iMX233/I2C/MOD-Wii-UEXT-NUNCHUCK.c

and write it to the SD card by SSH or flash dongle.

then you need to compile it

$ cc MOD-Wii-UEXT-NUNCHUCK.c -o wii

$ chmod +x wii

$ ./wii

now on the console connected to terminal you should see picture like this:


when you move the joystick, push the buttons or shake the Nunchuck you can see these numbers change.

Here is video of iMX233-OLinuXino running above code: http://www.youtube.com/watch?v=pSVG3LF7uqA


PACMAN and SPACE INVADERS retro games are rewritten in BASIC and available for Duinomite. You can even use the MOD-WII-UEXT-NUNCHUCK to play with them.

Here is the start page of MAXMAN (Pacman) for Duinomite:


and video of the game in action: http://www.youtube.com/watch?v=BaXAY_kdyvA

This is the SPACE INVADERS picture:


and video of the game in action: http://youtu.be/lInXVR_v1pU



WII NUNCKUCK is game controller for Nintendo Wii, as it’s produced in large quantities it may be obtained on very attractive price.

Inside the WII NUNCKUCK you have: 3 axes accelerometer, XY Joystick, 2 buttons. All this available through I2C communication so this makes it perfect candidate for UEXT connection.

We offer WII-NUNCKUK with MOD-WII-UEXT connector board set which allow the NUNCHUCK to be accesable by any of our boards with UEXT connector for only EURO 6.95!

As you guess the first boards we used to test the NUNCHUCKs is DuinoMite 🙂

There are now two games which use MOD-WII-UEXT-NUNCHUCK: Space invaders and Maxman (Pacman).

They both are uploaded on GitHub: https://github.com/OLIMEX/DuinoMite/tree/master/SOFTWARE/GAMES