Advertisement
Guest User

Untitled

a guest
Feb 12th, 2012
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement