while(!Serial.available()) {
}
char character = Serial.read();
if (character == "1")
startup(1);
if (character == "2")
startup(2);
can be improved a little. For example, if you do get a '1', you call startup() and then immediately check to see if it is a '2', which it can't be. A switch statement can prevent these unnecessary checks:
// ...
char character = Serial.read();
switch (character) {
case 1:
startup(1);
break;
case 2:
startup(1);
break;
default:
Serial.println("We shouldn't be here.");
break;
}
Another option that is not as self-documenting would be:
char character = Serial.read();
int index = character - '0'; // e.g., if character = '7', then (ASCII codes) 55 - 48 = 7
startup(index);
This would work for the two examples you've shown that use numeric indexes. Since all of the code wasn't posted, I don't know if non-numeric codes need to be processed.