SHARE
TWEET

Untitled

a guest Feb 12th, 2012 176 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Wire.h>
  2. #include <ArduinoNunchuk.h>
  3.  
  4. ArduinoNunchuk nunchuk = ArduinoNunchuk();
  5.  
  6. void setup()
  7. {
  8.   nunchuk.init();
  9.   pinMode(13, OUTPUT);    
  10. }
  11.  
  12. void loop()
  13. {
  14.   nunchuk.update();
  15.  
  16.   if(nunchuk.accelX > 530) {
  17.     digitalWrite(13, HIGH);
  18.   } else {
  19.     digitalWrite(13, LOW);
  20.   }
  21. }
RAW Paste Data
Want to get better at C?
Learn to code C in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top