+1 for the serial input basics. Sending packets with start and end markers will greatly aid in maintaining synchronization.