Gabotronics - February 2011
NUNCHUK DRIVER FOR THE XMEGA 

www.gabotronics.com
email me at: gabriel@gabotronics.com

Version History:
2011-02-28 version 0.1: First version, it looks like its working... :-)

This source code is offered for free, feel free to contact me with feedback,
suggestions and bug reports. I will be glad to improve this project with your
ideas.

The nunchuk has to be wired to the TWI pins on the XMEGA, currently I am using TWIC.

To use the library, just add the .c files on your project, call the initialization routine
once, and then call the read function when you want to read data, something like this:

int main(void) {
    init_my_hardware();
    init_nunchuck();
    for(;;) {
        delay();
        read_nunchuck();
        // ... use data ...
    }
}

The code uses a slightly modified version of the XMEGA TWI driver from ATMEL.