How to use EEPROM to save my settings value while the program is running.

Read the updated Serial Input Basics thread ti get ideas how to handle serial input.

The codes (example 2 and 3) use a flag (newData) to indicate that a complete message has arrived.