         "t    - set EPROM <t>ype\n"
         "h, ? - display this <h>elp\n"
       /*  "Ctrl-] - leave miniterm.py\n" */ );
-
+#endif // INTERACTIVE
+
+#if (INTERACTIVE == 0)
+ // Calculate based on max input size expected for one command
+ #define INPUT_SIZE 64
+
+char inputLine[INPUT_SIZE+1] = { 0 };
+int lineLength = 0;
+bool lineComplete = false;
+#endif // INTERACTIVE
 
 /**  */
 void loop() {
 
   static bool first = true;
+#if (INTERACTIVE == 0)
+  static byte output_format = 1;
+#else
   static byte output_format = 0;
+#endif // INTERACTIVE
+
+#if (INTERACTIVE == 0)
+  
+  int ch = Serial.read();
+
+  if ( ch == -1 ) return;
+  
+  // check for LF or add character to inputLine
+  if ( ch == 0x0a || ch == 0x0d ) {
+    lineComplete = true;
+  }
+  else {
+    // Add the final 0 to end the C string
+    inputLine[lineLength++] = ch;
+    inputLine[lineLength] = 0;
+  
+    // too many chars entered? clear line buffer and issue warning
+    if ( lineLength == INPUT_SIZE ) {
+      lineLength = 0;
+      inputLine[lineLength] = 0;
+      Serial << F("ERR: max. line length exceeded!") << endl;
+    }
+  }
+#endif // INTERACTIVE
 
 #ifdef TEST
   testCode();


  /* Initialize serial output at UART_BAUD_RATE bps */
  Serial.begin(UART_BAUD_RATE);
  Serial << F("FlashReader.ino starting ...") << endl;

  eeprom.setType(eepromType);
}

//
// flash strings for the main menu
//

#define DEBUG
// execute test code (if any)
#undef TEST
#define INTERACTIVE   0
#if (INTERACTIVE == 0)
 //#undef DEBUG
#endif

// http://arduiniana.org/libraries/streaming/
