             if (tmp_str[i + 1] == 'M' || tmp_str[i + 1] == 'm'){ // motor speed and acceleration
               int motor_index, motor_speed, motor_acceleration;
               sscanf(tmp_str + i + 2, "%d%d%d", &motor_index, &motor_speed, &motor_acceleration);
-              motors_control.set_motor_speed_and_acceleration(motor_index, motor_speed, motor_acceleration);
+              motors_controller.set_motor_speed_and_acceleration(motor_index, motor_speed, motor_acceleration);
               i += 5;
             }
             else
               if (tmp_str[i + 1] == 'P' || tmp_str[i + 1] == 'p'){ // potentiometer min max home
-                int pot_index, pot_min, pot_max, pot_home;
-                sscanf(tmp_str + i + 2, "%d%d%d%d", &pot_index, &pot_min, &pot_max, &pot_home);
-                potentiometers_control.set_limits(pot_index, pot_min, pot_max, pot_home);
+                int pot_index, pot_min, pot_max, pot_home, pot_pin;
+                sscanf(tmp_str + i + 2, "%d%d%d%d%d", &pot_index, &pot_pin, &pot_min, &pot_max, &pot_home);
+                potentiometers_control.set_params(pot_index, pot_pin, pot_min, pot_max, pot_home);
                 i += 7;
             }
           }

//--------------------------------------------------------------------------------------------
void setup() 
{
  motors_control.reset_pins();

  current_buffer[0] = 0;

  Serial.begin(115200); //Open Serial connection

        if (tmp_str[i] == 'D' || tmp_str[i] == 'd'){// disables motor
          int motor_index;
          sscanf(tmp_str + i + 1, "%d", &motor_index);
          motors_controller.disable_motor(motor_index);
          sprintf(serial_out, "D%d#", motor_index);
          i += 2;
        }
