Multiple serial commands

I want my arduino to recieve a serial message and run different commands based on the contents of the serial recieved. For example, if it recieved "r122" is would AnalogWrite (r, 122). If it recieved "r155" is would AnalogWrite(r, 155)... b130 = AnalogWrite(b, 130) etc.

Alternatively, it could recieve one message saying the next message should be applied to a certain pin.

How should I go about this?

MRMP is one way... http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1232140631

That's really cool, though I think there is more simple solution available; or I hope at least. Thanks

Just follow the tutorial and you should have it working in short order. MRMP is designed as a development environment. Once you have some experience with MRMP you will be amazed at how easy it is to quickly code new projects using MRMP controller.

checkout firmata, sounds like it could fit your needs.

could send something like

arduino.analogWrite();

directly from you pc program and not worry about the raw data yourself.