serial communication, program code