Now for something completely different This is a work in progress. I thought I would give a heads up about this, to see if anyone else is interested in this and to see if anyone has any suggestions. Sorry in advance for this random babbling.
For awhile now I wondered about the feasibility of making a version of the remote control based on using two WII nunchucks instead of normal joysticks. So over the last couple of days I started to play with the concept. One nice thing about these is that you can pick up one of these for under $15, and it has accelerometerer, plus joystick and 2 buttons and I happened to have 2 of them that I used with a WII console. Here are some of the places I have found useful information:
sparkfun.com/products/9281 : I purchased two of these awhile to connect the nunchucks without having to modify the nunchuck. But I misplaced one of them . So I used the other one to hook up the first one.
windmeadow.com/node/42 : This link shows which color wires are what. From this I connected up the 2nd one simply crimping pins onto the 4 wires.
todbot.com/blog/2008/02/18/wiich … available/ : Linked to by sparkfun. This is where I downloaded some test code for trying out one nunchuck on and Arduino using the hardware I2C.
hacknmod.com/hack/how-to-cheap-a … -nunchuck/
Step 1: Hook up the first nunchuck. I am using an Seeeduino Mega with prototype Botboarduino shield. Hooked up to 4 I2C pins. I tried out the test code up on todbot.com (link above) and it appears to work like a champ. I am passing 5V to the nunchuck and so far it appears to be fine…
Step 2: Hook up 2nd nunchuck. This is where it starts to get complicated. The nunchuck appears to have a fixed I2C address and I have not found any way to change it, so they can not be connected on the same I2C buss. I have seen a couple places on the net (like: wiimoteproject.com/general-d … uino-help/) , that fix this by using a couple of extra IO lines and transisitors hooked up to SDA lines of the two nunchucks to be used as enable lines. Did not like this approach as it requires hardware mods…
So I decided to try to hook up the 2nd one to 2 IO lines and use a software I2C library. I downloaded a library from (forums.adafruit.com/viewtopic.php?f=25&t=13722). I also hacked up the nunchuck test program from Step 1 to handle both. Unfortunately the 2nd one was not returning any valid data. I found that this library was a lot slower talking to the device than the hardware I2C, so I started to hack on the library. I replaced all of the calls like: digitalWrite(SDA_PIN, true), with a lot faster code. I did this by having the I2C init code map both the arduino SCL/SDA IO pins to the actual hardware port, pin, … So then at run time I could simple set/clear the appropriate bit. This sped it up a lot. Still no luck, so I spent a lot of time using my Logic Analyzer and looking at the hardware I2C trace and the Software I2C trace and tweaked the software code, until I finally got the timings almost identical and I now have it working pretty well.
Still need to clean this up.
Next Steps: Clean up the code to abstract out if I am using hardware or software.
Then: Build a version of the Phoenix Control that uses this. Will hook up an XBee… Hardware wise I may simply add the Nuncucks to my Arduino Remote… Assuming this works well then the fun begins. Things like how best to use these controls.
For example could use Left joystick to do the walking
Maybe use 1 set of acceleramters to maybe control translation?
Maybe use 2nd set for rotations?
Things I need to play with is, do you use the values of the acceleramters all of the time to change settings, or maybe only when a button is pressed?
…
Suggestions?
Kurt