This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 12th, 2012  |  syntax: C  |  size: 0.30 KB  |  views: 173  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data