Using a Nunchuck with WiiChuck.h

I'm still getting accustomed to how the whole Arduino IDE works, so this is a bit of a n00b question, sorry.

I want to use to use with a nunchuck (obviously). The only problem is that I'm not quite sure what to do with the Arduino 1.0 WiiChuck.h file. I've tried putting it in the same directory as my project (just the sample code), but when I come to run it, I get an error "WiiChuck does not name a type", and this:

Nunchuck1.cpp:4:22: error: WiiChuck.h: No such file or directory Nunchuck1:10: error: 'WiiChuck' does not name a type Nunchuck1.cpp: In function 'void setup()': Nunchuck1:18: error: 'chuck' was not declared in this scope Nunchuck1.cpp: In function 'void loop()': Nunchuck1:26: error: 'chuck' was not declared in this scope

I've just copied all the code straight from the playground, so I'm not sure what I'm doing wrong. (As I said, my source code is just the example given on the page, so no need for clarification there.)

Thanks in advance to anyone who can help,


Generally speaking you put library folders into the "libraries" folder (alongside where your sketches are) and then restart the IDE. It should then find it.

Alternatively, since this is just a .h file, you can make a new tab in the IDE (see button on top RH corner), call it WiiChuck.h, and then when the blank window opens, paste in that .h file contents from that page.

There's a lot of data on the page referenced, but I didn't notice it mentioned that the Nunchuck is a 3.3V device only. Not good to hook up to a 5V Arduino.

You might check the following page for very good info. I used the sketch and it worked 100% with a nunchuck connected to my 3.3V Ardino board.