Friday, November 22, 2013

WiiChuck Adapter - Controlling a Servo with the Nunchuk


Originally the adapter was not supposed to come in the mail until around the day before Thanksgiving. It ended up arriving last night, which is over a week early (and they sent me two!). I decided to fool around with it and see if I could get everything working. There is an online library for coding the WiiChuck, and many example codes as well. By using the libraries, and adding a few lines of code for controlling the servo, the servo could be controlled using the Nunchuk.

Testing the Nunchuk!

I have only tested the X and the Y axis from the Nunchuk so far. However, from reading the serial monitor in the Arduino interface it was clear that the buttons and the joystick do in fact work. The servo had a little difficulty moving with the negative X direction from the Nunchuk, which could be from using an old Nunchuk found in the bottom of an old video game box, or from not mapping the values from the Nunchuk correctly. Some experimentation with different Nunchuks and different values in the coding should resolve this problem. Another issue is that it is a little shaky in its values. This may be overcome by increasing the 'read time' from the Nunchuk, or by only changing the position when a certain increment of motion has occured.
--
Andrew Southworth

No comments:

Post a Comment