Using computer keyboard with Arduino

I'm trying to set this up so that when pin 12 and 6 are connected (when I push zero on the keyboard) that it will detect that and turn on the led for as long as I have it pressed. I then need it to do this for all the other combinations. However when I try to read the value its keeps alternating between 0 and 1 and then when i plug 11, 12, and 13 into the 3.3V it stays on 1 then when I unplug it it alternates again. I'm fairly new to all this so if it looks like I have no idea what I'm doing, then your right...

Here's the code I'm failing to use:

int R11 = 11;
int R12 = 12;
int R13 = 13;
int L3 = 3;
int L4 = 4;
int L5 = 5;
int L6 = 6;

void setup(){
  Serial.println("Connected To Arduino...");

  //Set all the pins we need to INPUT pins
  pinMode(L3, INPUT);
  pinMode(L4, INPUT);
  pinMode(L5, INPUT);
  pinMode(L6, INPUT);
  pinMode(R11, INPUT);
  pinMode(R12, INPUT);
  pinMode(R13, INPUT);
  pinMode(10, OUTPUT);
void loop (){
  if (Serial.available()) {

    //read serial as a character
    char ser =;

    //NOTE because the serial is read as "char" and not "int", the read value must be compared to character numbers
    //hence the quotes around the numbers in the case statement
    switch (ser) {
      case 'r':
        R12 = digitalRead(12);
        L6 = digitalRead(6);
          if (R12 == HIGH && L6 == HIGH) {         // check if the input is HIGH (button released)
    digitalWrite(10, HIGH);  // turn LED OFF
  } else {
    digitalWrite(10, LOW);  // turn LED ON
        goto READ;

Next I would like to make this into a password thinger you know so a red led lights when the wrong code is put in and so forth. The reason I'm using this keyboard rather than a keypad from like sparkfun or something is that I don't wanna buy one and wait for it to get here and I thought this way would be funer.

Here's some pictures of what I've done: (I can't figure out this forums picture thinger so theres the links haha)

I can't see any ground on the arduino, without a ground from the keyboard nothing will register.

I also can't see a series resistor with that LED either.

Where do I connect the ground? Just ground it on one wire or all the wires or only a few? And by series resistor do you mean just put a resistor between the anode and the Arduino?

The keyboard is powered I assume. That power has a ground connection. This needs to be connected with the arduino ground otherwise the inputs are floating and will not do anything. If this is not the case then post a schematic of what you are trying to do.

Yes you need a resistor in line with one leg of that led.

Ok so I don''t have the keyboard powered. I have it set up so when I push down the zero key it connects pins R12 and L6 (the R is the connector on the right and the L is the connector on the left). So like when I use a multimeter to test the continuity on R12 and L6 when I push zero it beeps cuz duh its connected. Anyways I need the Arduino to act like a continuity tester or something. So the hole is thing is like taking a button and instead of plugging it into ground and say pin 12 I'm plugging it into pin 6 and pin 12. So theres no ground in there. Hope that helps to explain since idk how to make a schematic of this whole thinger.

To make the arduino act like a continuity tester you need some pins to be inputs with the pull ups enabled and some to be outputs. You need to wire it so that the output set to zero will connect to the input when the key is pressed. Then when the key is pressed you read a zero, when not pressed you read a one because of the pull up resistor.

If you can't draw a schematic how can you possible make it?

Ok well I can make a schematic I'm just too lazy at the moment to make one. And how do I go about deciding which pins need to be Inputs and which need to be Outputs, and how do I decide what size of resistor to put on there?

Well I couod tell you but then I am too lazy at the moment.

If I make the schematic will you tell me? :D

Maybe ;)

long depressed sigh begins building a schematic