 				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:

	START,
	ERROR,
	IN_CMD,
	IN_SERVO,
	IN_STEPPER,
	IN_SCAN_PARAMETERS,

#define MAX_CM 1000

/* 
 * mesure configuration variables
 */
enum {
	MAX,
	COUNT,
	NVARS
};
int mesureConfig[NVARS];

/* 
 * servo
 */
#define SRV 12
