Arnov Sharma
Published © MIT

SUPER Nintendo Entertainment System Controller XL

Made a huge XL version of the SNES controller, probably the biggest SNES controller in the world?

BeginnerFull instructions provided1 hour365
SUPER Nintendo Entertainment System Controller XL

Things used in this project

Story

Read more

Custom parts and enclosures

Fusion360File

Schematics

sch

Code

CODE

C/C++
#include <Gamepad.h>


Gamepad gp;

void setup() {
  
  pinMode(0,  INPUT_PULLUP); //LEFTBUTTON
  pinMode(1,  INPUT_PULLUP); //RIGHTBUTTON
  pinMode(2,  INPUT_PULLUP); //UP
  pinMode(3,  INPUT_PULLUP); //DOWN
  pinMode(4,  INPUT_PULLUP); //LEFT
  pinMode(5,  INPUT_PULLUP); //RIGHT
  pinMode(6,  INPUT_PULLUP); //A
  pinMode(7,  INPUT_PULLUP); //B  
  pinMode(8,  INPUT_PULLUP); //A
  pinMode(9,  INPUT_PULLUP); //B  
  
}

void loop() {
  
  int UPLEFT, UPRIGHT, UP, DOWN, LEFT, RIGHT, RIGHTBUTTON, LEFTBUTTON, A, B, START, STOP;

  RIGHTBUTTON = digitalRead(0);
  LEFTBUTTON = digitalRead(1);
  UP = digitalRead(2);
  DOWN = digitalRead(3);
  LEFT = digitalRead(4);
  RIGHT = digitalRead(5);
  A = digitalRead(6);
  B = digitalRead(7);
  START = digitalRead(8);
  STOP = digitalRead(9);
  
      
  if(UP == LOW)
    gp.setButtonState(2, true);
  else
    gp.setButtonState(2, false);

  if(DOWN == LOW)
    gp.setButtonState(3, true);
  else
    gp.setButtonState(3, false);    

  if(LEFT == LOW)
    gp.setButtonState(4, true);
  else
    gp.setButtonState(4, false); 

  if(RIGHT == LOW)
    gp.setButtonState(5, true);
  else
    gp.setButtonState(5, false);     

  if(RIGHTBUTTON == LOW)
    gp.setButtonState(1, true);
  else
    gp.setButtonState(1, false);   

  if(LEFTBUTTON == LOW)
    gp.setButtonState(0, true);
  else
    gp.setButtonState(0, false);     

  if(A == LOW)
    gp.setButtonState(6, true);
  else
    gp.setButtonState(6, false);  

  if(B == LOW)
    gp.setButtonState(7, true);
  else
    gp.setButtonState(7, false);  

  if(START == LOW)
    gp.setButtonState(8, true);
  else
    gp.setButtonState(8, false);   

  if(STOP == LOW)
    gp.setButtonState(9, true);
  else
    gp.setButtonState(9, false); 

  delay(20);
}

Credits

Arnov Sharma

Arnov Sharma

305 projects • 305 followers
Just your average MAKER

Comments