Ship model controlled using Arduino

You could set up your code to have to do certain code sequence defined.
For example, your main loop would just look for a character to come in, then perform the code for that character.

void loop(){
if (Serial.available()>0){  // character is in the queue
commandCode = Serial.read();  // go get it
}
switch(commandCode){  // now do the code
case 'a':
// do the code for 'a'
commandCode = 0;  // clear the command if you only want it to run 1 time
// or leave it equal to 'a' if you want this section of code to run again without another character being received
break;
case 'b':
// do the code for 'b'
commandCode = 0;  // clear the command if you only want it to run 1 time
// or leave it equal to 'b' if you want this section of code to run again without another character being received

break;
:
:
case 'z':
// do the code for 'z'
commandCode = 0;  // clear the command if you only want it to run 1 time
// or leave it equal to 'z' if you want this section of code to run again without another character being received

break;
case 0:
// do nothing
break;
} // end switch
} // void loop