Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Gyro inside the Nunchuck for TetrisWithNunchuck game control with your wrist #239

Open
ReinerZ opened this issue Aug 17, 2024 · 0 comments

Comments

@ReinerZ
Copy link

ReinerZ commented Aug 17, 2024

Inside TetrisWithNunchuck.ino after line 412 ... 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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant