 	configure();
 	
 	// Start the serial port.
-	Serial.begin(9600);
+	Serial.begin(115200);
 	
 	// Wait two seconds.
-	Serial.println("hello world");
+	Serial.println("Boot v2.0");
 	
 	// Select a default clip mode from the set of possible modes, if one is not set.
 	eClipMode = EEPROM.read(EEMODEADDR);
-	if (eClipMode != EEMODE_SYNCPULSE && eClipMode != EEMODE_HEIGHTONLY)
-	{
-		EEPROM.write(EEMODEADDR, EEMODE_HEIGHTONLY);
-		eClipMode = EEMODE_HEIGHTONLY;
-	}
-	
+        switch( eClipMode )
+        {
+          case EEMODE_SYNCPULSE:
+            break;
+          case EEMODE_HEIGHTONLY:
+            break;
+          case EEMODE_SERIAL:
+            break;
+          default:
+            eClipMode = EEMODE_HEIGHTONLY;
+            EEPROM.write(EEMODEADDR, EEMODE_HEIGHTONLY);
+        }
+	
+        // Debug Mode
+        eClipMode = EEMODE_SERIAL;
+
 	// Wait for a random time so that not all clips zero their motor at the same time.
 	randomSeed(analogRead(PIN_RND));
 	uint16_t randomWait = random(1000);

	
}

/**
 * Logic loop.
 * The function performs the following tasks:


#define EEMODEADDR 0			// The address of the mode stored in EEPROM.
#define EEMODE_CHANGETIME 5000  // The number of ms to hold the switch before the clip mode is changed.
#define EEMODE_SYNCPULSE  45		// The Clip looks for a sync pulse on one of the LDRs.
#define EEMODE_HEIGHTONLY 37	// The Clip uses both LDRs to estimate height, no colour involved.
#define EEMODE_SERIAL     89

#define PULSE_STATE__NOT_CHECKED  -1	// The sync-pulse routine did not bother checking, too soon since previous check.
#define PULSE_STATE__NO_PULSE      0	// The sync-pulse check returned no pulse.. Probably off a screen.
