Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. /*
  2. Copyright (c) 2014-2016 NicoHood
  3. See the readme for credit to other people.
  4. GamecubeConsole example
  5. Read controller and mirror data to the gamecube
  6. */
  7.  
  8. #include "Nintendo.h"
  9.  
  10. // Define a Gamecube Controller and a Console
  11. CGamecubeController GamecubeController1(7);
  12. CGamecubeConsole GamecubeConsole1(8);
  13.  
  14. void setup()
  15. {
  16. }
  17.  
  18.  
  19. void loop()
  20. {
  21. // Try to read the controller data
  22. if (GamecubeController1.read())
  23. {
  24. // Mirror the controller data to the console
  25. if (!GamecubeConsole1.write(GamecubeController1))
  26. {
  27. delay(2000);
  28. }
  29. }
  30. else
  31. {
  32. delay(1000);
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement