Code runs on Duemilanove but not on UNO

When I run this on an UNO it seem to get hung up in the armed loop works completely fine on a Duemilanove

Can anyone tell me why?
Or what i can do to fix?

This is the code:

const int led = 13;
String inputString = "";         // a string to hold incoming data
boolean stringComplete = false;  // whether the string is complete
boolean start = false;
boolean print1 = true;
String PW = "test";
void setup()
{
  pinMode(led, OUTPUT);
  Serial.begin(9600);                                 // initialize serial:
}
void loop()
{
  if (print1 == true)
  {
    Serial.println("Disarmed. Enter password to Arm");  //print "Armed"
    print1 = false;                                      // make sure only print message once
  }
  readkeyboard();                                     //call the function
  if (stringComplete == true)                         // print the string when a newline arrives:
  {
    inputString = "";                                 // clear the string:
    stringComplete = false;                           // clear the flag
  }
  while (start == true)                              // while start is true run the armed function
  {
    Armed();                                          //call the function
  }
}

void Armed()                                          //armed function
{
  if (print1 == false)                                 // make sure only print message once
  {
    Serial.println("Armed! Enter password to disarm"); //print "Armed"
    print1 = true;                                      // make sure only print message once
  }
  readkeyboard();                                   //call the function
  if (stringComplete == true)                       // print the string when a newline arrives:
  {
    inputString = "";                               // clear the string:
    stringComplete = false;                         // clear the flag
  }
  if (start == false)
  {
    digitalWrite(led, LOW);
    return;
  }
  digitalWrite(led, HIGH);                         //turn on led or insert other code in here eg blink without delay + buttons
}


void readkeyboard()
{
  while (Serial.available()) {
    char inChar = (char)Serial.read();// get the new byte:
    inputString += inChar; // add it to the inputString:
    if (inChar == '\r') // if the incoming character is a cr, set a flag
    {
      stringComplete = true; // so the main loop can do something about it:
      delay(10);
    }
    if (inputString == PW)
    {
      start = !start;    // toggle
    }
  }
}

The examples in Serial Input Basics don' rely on a delay() when receiving data and may solve the problem.

Are you sure that a '\r' chraracter is sent in both cases?

...R

Thanks, I have removed the delay. Still the same result. Runs perfect on Duemilanove. On the UNO I can get into the armed loop but will not exit out.

"I'm confused"

Did you try my examples?

I would be interested to hear if they don't work.

I presume you mean one of these old boards

...R

Not sure what was going on but appears to working now on both boards. Thanks for the help.