         else if (tmp_str[i + 1] == 'B' || tmp_str[i + 1] == 'b') { // get button pin direction
           int button_index;
           byte _pin;
-          int _dir;
+          unsigned char _dir;
           sscanf(tmp_str + i + 2, "%d", &button_index);
           buttons_controller.get_params(button_index, &_pin, &_dir);
           sprintf(tmp_serial_out, "GB%d %d %d#", button_index, _pin, _dir);

          i += 4;
        }
        else if (tmp_str[i + 1] == 'P' || tmp_str[i + 1] == 'p') { // get potentiometer min max home dir
          int pot_index, pot_min, pot_max, pot_home, pot_dir;
          byte pot_pin;
          sscanf(tmp_str + i + 2, "%d", &pot_index);
          potentiometers_controller.get_params(pot_index, &pot_pin, &pot_min, &pot_max, &pot_home, &pot_dir);

            int sensor_index;
            sscanf(tmp_str + j + 1, "%d", &sensor_index);
            if (motor_type == 'S' || motor_type == 's') // attach to stepper motors controller
              stepper_motors_controller.add_sensor(motor_index, INFRARED_ANALOG, sensor_index);
            else if (motor_type == 'D' || motor_type == 'd') // attach to DC motors controller
              dc_motors_controller_TB6612FNG.add_sensor(motor_index, INFRARED_ANALOG, sensor_index);
            j += 2;
            k++;
          }
