galagino
galagino copied to clipboard
Use the Gyro inside the Nunchuck for additional game control with your wrist
Inside Nunchuck.h, after line 45 ... add
// Read the accelerometer (0-1023)
int accelX = nchuk.accelX();
if (accelX > 600) joyX = 255;
if (accelX < 400) joyX = 0;
int accelY = nchuk.accelY();
if (accelY > 600) joyY = 255;
if (accelY < 400) joyY = 0;
// int accelZ = nchuk.accelZ(); not used ...
Now you can also control the Nunchuck with your wrist, have fun :-)