Created
April 19, 2018 19:34
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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