   current_buffer[0] = 0;
   is_command_running = 0;
 }
+
+//--------------------------------------------------------------------------------------------
+void parse_and_execute_commands(char* tmp_str)
+{
+ // int i = 0;
+  
+              if (tmp_str[0] == 'M' || tmp_str[0] == 'm'){// moves motor
+                int motor_index, num_steps;
+                sscanf(tmp_str, "%d%d", &motor_index, &num_steps);
+                motors_control.move_motor(motor_index, num_steps);
+                is_command_running = 1;
+              }
+              else
+                if (tmp_str[0] == 'D' || tmp_str[0] == 'd'){// disables motor
+                  int motor_index;
+                  sscanf(tmp_str, "%d", &motor_index);
+                  motors_control.disable_motor(motor_index);
+                }
+                else
+                  if (tmp_str[0] == 'L' || tmp_str[0] == 'l'){// locks motor
+                    int motor_index;
+                    sscanf(tmp_str, "%d", &motor_index);
+                    motors_control.lock_motor(motor_index);
+                  }
+                else
+                  if (tmp_str[0] == 'S' || tmp_str[0] == 's'){// motor speed
+                    int motor_index, motor_speed;
+                    sscanf(tmp_str, "%d%d", &motor_index, &motor_speed);
+                    motors_control.set_motor_speed(motor_index, motor_speed);
+                  }
+                else
+                  if (tmp_str[0] == 'A' || tmp_str[0] == 'a'){// motor acceleration
+                    int motor_index, motor_acceleration;
+                    sscanf(tmp_str, "%d%d", &motor_index, &motor_acceleration);
+                    motors_control.set_motor_acceleration(motor_index, motor_acceleration);
+                  }
+                else
+                  if (tmp_str[0] == 'U' || tmp_str[0] == 'u'){// ultrasonic
+                    int sensor_index;
+                    sscanf(tmp_str, "%d", &sensor_index);
+                      Serial.print(ultrasonic.Ranging());
+                  }
+                else
+                  if (tmp_str[0] == 'P' || tmp_str[0] == 'p'){// ultrasonic
+                    int sensor_index;
+                    sscanf(tmp_str, "%d", &sensor_index);
+                      Serial.print(potentiometers_control.getPotentiometerValue(sensor_index));
+                  }
+  
+}
 //--------------------------------------------------------------------------------------------
 //Main loop
 void loop() {


char is_command_running;

char firmware_version[] = "2015.11.20.0";// year.month.day.version

char current_buffer[65];


          for (; j < buffer_length && current_buffer[j] != '#'; j++);// parse until I find the termination char
          if (j < buffer_length){
              char tmp_str[64];
              strncpy(tmp_str, current_buffer + i, j - i);
              tmp_str[j - i - 1] = 0;

              #ifdef DEBUG
