REPEAT
   wait for serial command;
   decode serial command;
   switch relays as required;
FOREVER.