Skip to content

Instantly share code, notes, and snippets.

@Jbithell
Created April 19, 2018 19:34
Show Gist options
  • Save Jbithell/790b692043aabb3eb2624b71890961e9 to your computer and use it in GitHub Desktop.
Save Jbithell/790b692043aabb3eb2624b71890961e9 to your computer and use it in GitHub Desktop.
For use in conjunction with https://github.com/ETCLabs/lighthack/tree/master/user_projects/nunchuk - replace the main arduino code with this and open arduino serial terminal to check joystick calibration
#include <Wire.h>
#include "WiiLib.h"
WiiChuck chuck = WiiChuck();
void setup() {
Serial.begin(9600);
chuck.begin();
chuck.update();
chuck.calibrateJoy();
}
void loop() {
delay(20);
chuck.update();
Serial.print(chuck.readJoyX());
Serial.print(" ");
Serial.print(chuck.readJoyY());
Serial.println();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment