 				{
 					// Set the flag and update the motor height.
 					bOnScreen = true;
-					iTargetPos = constrain(map(iMean, min, max, 0, MOTOR_TRAVEL), 0, MOTOR_TRAVEL);
+					iTargetPos = constrain(map(valueVariance->mean(), min, max, 0, MOTOR_TRAVEL), 0, MOTOR_TRAVEL);
 				}
 				else
 				{

//#define SERIAL_INFO			// Should device values be streamed via serial? csv: ms, ldr1, ldr2, rgb, height, frc, haspulse, swbot
//#define SERIAL_SYNC_DEBUG		// Should sync pulse debug data be streamed via serial? csv: ms, r, g, b
//#define SERIAL_SYNC_DEBUG2	// Should the verbose sync pulse debug data be streamed via serial? csv: ms, slope, max, r, g, b, min, raw

/** Colour modes - how the RGB LED is controlled. */
#define RGBMODE_NONE     0		// The RGB LED displays nothing.

	Serial.begin(115200);
	
	// Wait two seconds.
	Serial.println("Boot v2.5");
	
	// Select a default clip mode from the set of possible modes, if one is not set.
	eClipMode = EEPROM.read(EEMODEADDR);
