I'm working on an Arduino based controller for an electric canoe. In the process of doing that, I've been looking more closely at the data coming off the wii Nunchuck. Using the avr math libraries, and the atan2 function, you can combine the data from the X and Z accelerometers on the nunchuck to get a nice smooth 360 degrees of roll information. Because this is using an inverse tangent function, it also makes for more accurate angular data than the raw data coming off the device.
Here's a quick demo video, followed by links to the code.
I posted all three files needed for this on the Arduino Playground.
For hardware setup, Todbot's little adapter is the best.
ps. For this same canoe project I wrote up a library for the Wii Classic Controller as well. For anyone interested, that's available here.
UPDATE:
George's asks a good question in the comments. If you try and run the code posted on the arduino playground. It's important to note that the third chunk of code needs to be run from the processing application, available here at processing.org.
Sunday, May 4, 2008
Thursday, May 1, 2008
NES coffee table update 6: wiring and final construction
While I was giving the coffee table its final paint job, I managed to get my hands on a spare NES controller PCB from a friend (The rubber contacts for the controller it was from were knackered, so I didn't ruin a perfectly good NES controller)
So I got some more coloured wires from Dick Smith and soldered them on to the NES PCB.
This is pretty easy because all of the button contacts ran back to a solder point on the board.
I soldered the other end of the wires to a female 9-pin plug I also got from Dick Smith, so that I could plug it in and unplug it from the wiring on the coffee table.

Meanwhile, I had to put the hinges on the lid and bottom part of the table so it could open and close.
I Had to chisel out the area where the hinges sat, so that they didn't protrude from the surface, creating a gap between the lid and the base.
I also needed to glue screw another piece of wood to the edge that the hinges would sit on, to thicken it up (the 18mm MDF wasn't thick enough to screw the hinges into).
Here is what the hinges looked like once they were screwed in. The pin also comes out, so I can take the lid off whenever I want, like if I needed to repair it or something.
Here is all the wiring for the buttons from the back. The wires there lead into the male side of the 9-pin plug.
Here is how I made the button contacts. The big piece of the underside of the button is a piece of copper, which is connected to the ground wire.
I used a piece of brass for the other side of the contact because it is more springy than copper, thus it won't just bend flat if the button is pressed all the way down.
And here are the final pictures of how the coffee table looks, all finished and awesome-like!
Well it's not quite finished yet; my sister stole the piece of glass that I had designed this for (which sits on top, so you can use it as a table), so I had to order a new one from mitre10 (130 fookin' bucks! That's more than this whole thing cost to make!).

May awesomely daggy 60s styled futon.
Here you can see I have already filled it with crap. It's good though, my room is now a whole lot cleaner.
p.s. that's not my n-gage, is swear...... it's my spare one...
And here's a picture of my girlfriend having enormous amounts of retarded-looking fun playing Super Mario bros. 3;


Okay, I got one more post for the coffee table, even though it's finished.
I'll post a picture of what it looks like with the piece of glass on, and I'll post a video of us having
mega-awesome fun playing it together (and me kind of cracking the shits at Emily for not jumping at the right time.)
And I think I'll also post links to all of the NES coffee table posts, so it's easier to view the progress.
So I got some more coloured wires from Dick Smith and soldered them on to the NES PCB.
This is pretty easy because all of the button contacts ran back to a solder point on the board.
I Had to chisel out the area where the hinges sat, so that they didn't protrude from the surface, creating a gap between the lid and the base.
I also needed to glue screw another piece of wood to the edge that the hinges would sit on, to thicken it up (the 18mm MDF wasn't thick enough to screw the hinges into).
I used a piece of brass for the other side of the contact because it is more springy than copper, thus it won't just bend flat if the button is pressed all the way down.
Well it's not quite finished yet; my sister stole the piece of glass that I had designed this for (which sits on top, so you can use it as a table), so I had to order a new one from mitre10 (130 fookin' bucks! That's more than this whole thing cost to make!).
p.s. that's not my n-gage, is swear...... it's my spare one...
Okay, I got one more post for the coffee table, even though it's finished.
I'll post a picture of what it looks like with the piece of glass on, and I'll post a video of us having
mega-awesome fun playing it together (and me kind of cracking the shits at Emily for not jumping at the right time.)
And I think I'll also post links to all of the NES coffee table posts, so it's easier to view the progress.
Subscribe to:
Posts (Atom)