Basic relay control from serial input

This code waits for an input from the serial port. The input controls a
relay state where each state has a specific value.