have a look at this tutorial (also available in the Introductory Tutorials section)
Serial Input Basics
hope that helps...