Skip to content

Instantly share code, notes, and snippets.

@efatsi
Created February 14, 2014 16:07
Show Gist options
  • Save efatsi/9003747 to your computer and use it in GitHub Desktop.
Save efatsi/9003747 to your computer and use it in GitHub Desktop.
/*
* Setup
*
*
* ||| |||
* |||A||||B|||
* |||C||||D|||
*
*
* A - A5
* B - GND
* C - 5V
* D - A4
*/
#include <Wire.h>
#include <ArduinoNunchuk.h>
ArduinoNunchuk nunchuk = ArduinoNunchuk();
void setup()
{
Serial.begin(9600);
nunchuk.init();
}
void loop()
{
nunchuk.update();
Serial.print(nunchuk.analogX, DEC);
Serial.print(' ');
Serial.print(nunchuk.analogY, DEC);
Serial.print(' ');
Serial.print(nunchuk.zButton, DEC);
Serial.print(' ');
Serial.println(nunchuk.cButton, DEC);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment