SEGA Genesis/Mega Drive Controller USB

I'm currently working on a project for a undergrad class, the goal being to set up a SEGA Genesis controller to work with a PC using the Arduino Uno. In addition I also intend to put an accelerometer I got from a Wii Nunchuck so that the Genesis controller will be able to detect tilt/motion controls.

Right Now I have controller plugged in with serial ports 1 through 9 from the genesis's plug connected into the following:
Port 1 From Gen-> Digital 1 On Arduino
Port 2 From Gen-> Digital 2 On Arduino
Port 3 From Gen-> Digital 3 On Arduino
Port 4 From Gen-> Digital 4 On Arduino
Port 5 From Gen-> Power 5V On Arduino
Port 6 From Gen-> Digital 6 On Arduino
Port 7 From Gen-> Digital 7 On Arduino
Port 8 From Gen-> Power GND On Arduino
Port 9 From Gen-> Digital 9 On Arduino

The area in which I need the most help is figuring out the coding. I've never done much programming prior to taking this class, my only experience being a class in Python. Any help, suggestions, or feedback would be greatly appreciated.

Analog stick has been removed from the nunchuck to make it easier to fit into the Gen controller.

Current Code:

int UP = 0;
int DOWN = 1;
int LEFT = 2;
int RIGHT = 3;
int AB = 4;
int STARTC = 5;
char controller_data[8];

/* SETUP */
void setup()
{
  Serial.begin(115200);
  pinMode(UP,OUTPUT);
  pinMode(DOWN,OUTPUT);
  pinMode(datin,INPUT);
}

/* CONTROLLER READ */
void controllerRead()
{
  digitalWrite(UP, LOW);
  digitalWrite(DOWN,LOW);
  digitalWrite(LEFT,LOW);
  digitalWrite(RIGHT,LOW);
  digitalWrite(AB,LOW);
  digitalWrite(STARTC,LOW);
  delayMicroseconds(200);
  digitalWrite(UP,LOW);
  if (digitalRead(datin) == 1)
  {
    controller_data[0] = 'x';
  }
  else
  {
    controller_data[0] = 'o';*/
  }
 
  {
    digitalWrite(UP,HIGH);
    delayMicroseconds(200);
    if (digitalRead(datin) == 1)
    {
      controller_data[i] = 'x';
    }
    else
    {
      controller_data[i] = 'o';
    }
    digitalWrite(DOWN,LOW);
    delayMicroseconds(200);
  }

}*/

/* PROGRAM */
void loop()
{
  controllerRead();
  for (int i = 0; i <= 7; i++){
   Serial.print(controller_data[i]);
   delayMicroseconds(200);
   }
   Serial.println('z');
  delay(10);
}
import processing.serial.;
println(Serial.list());

Serial GENjoy;
String buttons;
Robot VKey;
PImage bg;

void setup() 
{
  size(434,180);
  frameRate(30);
  
  String portName = Serial.list()[4];
  
  GENjoy = new Serial(this, portName, 115200);
  try
  {
    VKey = new Robot();
  }
  catch(AWTException a){}
  GENjoy.buffer(11);
  buttons = "...";
  // The image NES-Controller.jpg has to be in the same map as the .pde / binary
  bg = loadImage("NES-Controller.jpg");
}

void draw()
{
  background(bg);
  fill(255, 255, 0);
  // Check all keys
  for (int i = 0; i <= 7; i++)
  {
    // Is button pressed?
    if (buttons.charAt(i) == 'o')
    {
      // Press the appropiate key
      switch(i)
      {
      case 0:
        VKey.keyPress(KeyEvent.VK_A);
        ellipse(363,127,40,40);  // A
        break;
      case 1:
        VKey.keyPress(KeyEvent.VK_B);
        ellipse(307,127,40,40);  // B
        break;
      case 2:
        VKey.keyPress(KeyEvent.VK_E);
        rect(155, 121, 37, 15);  // Select
        break;
      case 3:
        VKey.keyPress(KeyEvent.VK_T);
        rect(211, 121, 37, 15);  // Start
        break;
      case 4:
        VKey.keyPress(KeyEvent.VK_U);
        rect(61, 68, 28, 24);    // Up
        break;
      case 5:
        VKey.keyPress(KeyEvent.VK_D);
        rect(61, 122, 28, 24);   // Down
        break;
      case 6:
        VKey.keyPress(KeyEvent.VK_L);
        rect(36, 93, 24, 28);    // Left
        break;
      case 7:
        VKey.keyPress(KeyEvent.VK_R);
        rect(90, 93, 24, 28);    // Right
        break;
    }}
    // Is the button released?
    if (buttons.charAt(i) == 'x')
    {
      // Release the appropiate key
      switch(i)
      {
      case 0:
        VKey.keyRelease(KeyEvent.VK_A);
        break;
      case 1:
        VKey.keyRelease(KeyEvent.VK_B);
        break;
      case 2:
        VKey.keyRelease(KeyEvent.VK_E);
        break;
      case 3:
        VKey.keyRelease(KeyEvent.VK_T);
        break;
      case 4:
        VKey.keyRelease(KeyEvent.VK_U);
        break;
      case 5:
        VKey.keyRelease(KeyEvent.VK_D);
        break;
      case 6:
        VKey.keyRelease(KeyEvent.VK_L);
        break;
      case 7:
        VKey.keyRelease(KeyEvent.VK_R);
        break;
      }}}
}

// This event gets activated as soon as the buffer is full
serialEvent(Serial GENjoy)
{
  // Read the buffer into a string
  buttons = GENjoy.readString();
}

The code is edited from the code posted by the user Prodigity on Instructables.

As you may guess I am currently focusing on just getting the Genesis controller to work on the PC before I worry about tackling the motion controls aspect.Any advice on how to fix the code so that it works for what I need would be appreciated.