Fixed logic. Adapted for more blocks. Changed LocoNet Tx pin.