       isHigh = true;
       lastTime = now;
     }
+    else if(mode == binary && now > (lastTime + waitTime))
+    {
+      mode = error;
+      Serial.println("Timeout");
+    }
   }
 }
 

      case 'h':
      case 'H':
        mode = human;
        Serial.println("Human readable mode - only ASCII allowed. Escape to exit");
        break;
      case 'x':
      case 'X':

#define PinTransportMotor 11
#define PinStepSensor 12

#define highTime 2
#define lowTime 18
#define waitTime 5000

int pins[] = {PinBit0, PinBit1, PinBit2, PinBit3, PinBit4, PinBit5, PinBit6, PinBit7};

enum writeMode {error, ascii, binary, hex, dec, baudot, human};
