 #define MAX_CM 1000
 
 /* 
+ * mesure configuration variables
+ */
+enum {
+	MAX,
+	COUNT,
+	NVARS
+};
+int mesureConfig[NVARS];
+
+/* 
  * servo
  */
 #define SRV 12

int telemeterMesure() {
	unsigned long echoDuration;
	unsigned int mesureCm;
	digitalWrite(TRIGGER, HIGH);
	delayMicroseconds(10);
	digitalWrite(TRIGGER, LOW);
	echoDuration = pulseIn(INECHO, HIGH, ECHO_TIMEOUT);
	mesureCm = echoDuration ? ECHO2CM(echoDuration) : MAX_CM;
	return mesureCm;
}


				newState = SENSOR_MESURE;
			else if (!strcmp(input,"SCAN"))
				newState = IN_SCAN_PARAMETERS;
			else if (!strcmp(input,"SET"))
				newState = IN_VAR;
			break;

		case IN_VAR:
			if (!(input = userInput("VARIABLE: ")))
				while (!(input = userInput(NULL)));
			if (!strcmp(input,"MAX"))
				newState = IN_MAX;
			else if (!strcmp(input,"COUNT"))
				newState = IN_COUNT;
			break;

		case IN_MAX:
			if (!(input = userInput("DISTANCE MAX: ")))
				while (!(input = userInput(NULL)));
			mesureConfig[MAX] = atoi(input);
			newState = IN_CMD;
			break;

		case IN_COUNT:
			if (!(input = userInput("MESURE COUNT: ")))
				while (!(input = userInput(NULL)));
			mesureConfig[COUNT] = atoi(input);;
			newState = IN_CMD;
			break;

		case IN_SERVO:
