Advertisement
tuixte

Wii Nunchuk Mouse - Sketch

Feb 23rd, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <Wire.h>
  2. #include <ArduinoNunchuk.h>
  3.  
  4. ArduinoNunchuk nunchuk = ArduinoNunchuk();
  5.  
  6. void setup()
  7. {
  8.   Serial.begin(19200);
  9.   nunchuk.init();
  10. }
  11.  
  12. void loop()
  13. {
  14.   nunchuk.update();
  15.  
  16.   Serial.print(nunchuk.analogX, DEC);
  17.   Serial.print(' ');
  18.   Serial.print(nunchuk.analogY, DEC);
  19.   Serial.print(' ');
  20.   Serial.print(nunchuk.cButton, DEC);
  21.   Serial.print(' ');
  22.   Serial.println(nunchuk.zButton, DEC);
  23.  
  24.   delay(1);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement