GBA help with how to program

Hello,

I am new to Arduino and need some help programming this code. What I am trying to do is use 8 pushbuttons to make a controller for an GBA emulator on linux.
I am looking for something like if button 1 is pushed "it presses" the A key on the keyboard. So that when I set up the emulator I can tell it to use a keyboard.
I am new to arduino and don't know ho to program this. If you could help me with the code and tell me what each section does that would be great!! thanks.

Are you looking for someone to write the code for you? If so, you want the Gigs and Collaboration forums, but be prepared to offer compensation.

If you want to emulate key presses with buttons it's cheaper to take the electronics from a used USB keyboard and connect buttons to pairs of wires to replace the keyboard keys you want.

johnwasser:
If you want to emulate key presses with buttons it's cheaper to take the electronics from a used USB keyboard and connect buttons to pairs of wires to replace the keyboard keys you want.

^ This.

Or antoher one is an Leonardo, I haven't messed with one, but I think theres a library for them that allows it to emulate a USB keyboard or mouse perfectly, SO somethign like that will probably make your project a bit easier (some USB keyboards can suck pretty hard to take apart)

I will note though, GBA will require 10 buttons (Up, Down, Left, Right, A, B, R, L, Start, and Select)

int button1 = 2;  // Set a button to any pin
int button2 = 3;  // Set a button to any pin
int button3 = 4;  // Set a button to any pin
int button4 = 5;  // Set a button to any pin
int button5 = 6;  // Set a button to any pin
int button6 = 7;  // Set a button to any pin
int button7 = 8;  // Set a button to any pin
int button8 = 9;  // Set a button to any pin
int button9 = 10;  // Set a button to any pin
int button10 = 15;  // Set a button to any pin

void setup()
{
  pinMode(button1, INPUT);  // Set the button as an input
  pinMode(button2, INPUT);  // Set the button as an input
  pinMode(button3, INPUT);  // Set the button as an input
  pinMode(button4, INPUT);  // Set the button as an input
  pinMode(button5, INPUT);  // Set the button as an input
  pinMode(button6, INPUT);  // Set the button as an input
  pinMode(button7, INPUT);  // Set the button as an input
  pinMode(button8, INPUT);  // Set the button as an input
  pinMode(button9, INPUT);  // Set the button as an input
  pinMode(button10, INPUT);  // Set the button as an input
  digitalWrite(button1, HIGH);  // Pull the button HIGH
  digitalWrite(button2, HIGH);  // Pull the button HIGH
  digitalWrite(button3, HIGH);  // Pull the button HIGH
  digitalWrite(button4, HIGH);  // Pull the button HIGH
  digitalWrite(button5, HIGH);  // Pull the button HIGH
  digitalWrite(button6, HIGH);  // Pull the button HIGH
  digitalWrite(button7, HIGH);  // Pull the button HIGH
  digitalWrite(button8, HIGH);  // Pull the button HIGH
  digitalWrite(button9, HIGH);  // Pull the button HIGH
  digitalWrite(button10, HIGH);  // Pull the button HIGH
}

void loop()
{
   if (digitalRead(button1) == 0)  // if the button goes low
  {
    Keyboard.write('z');  // send a 'z' to the computer via Keyboard HID
  }
  if (digitalRead(button2) == 0)  // if the button goes low
  {
    Keyboard.write('z');  // send a 'z' to the computer via Keyboard HID
  }
  if (digitalRead(button3) == 0)  // if the button goes low
  {
    Keyboard.write('z');  // send a 'z' to the computer via Keyboard HID
  }
  if (digitalRead(button4) == 0)  // if the button goes low
  {
    Keyboard.write('z');  // send a 'z' to the computer via Keyboard HID
  }
  if (digitalRead(button5) == 0)  // if the button goes low
  {
    Keyboard.write('z');  // send a 'z' to the computer via Keyboard HID
  }
  if (digitalRead(button6) == 0)  // if the button goes low
  {
    Keyboard.write('z');  // send a 'z' to the computer via Keyboard HID
  }
  if (digitalRead(button7) == 0)  // if the button goes low
  {
    Keyboard.write('z');  // send a 'z' to the computer via Keyboard HID
  }
  if (digitalRead(button8) == 0)  // if the button goes low
  {
    Keyboard.write('z');  // send a 'z' to the computer via Keyboard HID
  }
  if (digitalRead(button9) == 0)  // if the button goes low
  {
    Keyboard.write('z');  // send a 'z' to the computer via Keyboard HID
  }
 if (digitalRead(button10) == 0)  // if the button goes low
  {
    Keyboard.write('z');  // send a 'z' to the computer via Keyboard HID
  }
}

Would this work ?? the z's will be changed to the letter I want to be used.
What my friend and I are trying to do is make a old game emulator and put it into a TI-84 SE calculator. We are going to be using the rhasberry pi with Debian to install our Emulators for GBA,GBC, SNES, GC, ATARI, and NES on. We need the Arduino to send button presses from a pcb board we are making to the rhasberry pi via USB.