daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Hat buttons
  2. if (digitalRead(11) == LOW) // Hat up________
  3.   {
  4.     Joystick.hat(0);
  5.   }
  6.   else if (digitalRead(12) == LOW) // Hat down________
  7.   {
  8.     Joystick.hat(180);
  9.   }
  10.  else if (digitalRead(13) == LOW) // Hat right________
  11.   {
  12.    Joystick.hat(90);
  13.   }
  14. else if (digitalRead(14) == LOW) // Hat left________
  15.   {
  16.     Joystick.hat(270);
  17.   }
  18.   else // Hat centre________
  19.   {
  20.     Joystick.hat(-1);
  21.   }
  22.  
  23.  
  24.   delay(50);
  25. }
RAW Paste Data
Top