           if (tmp_str[i] == 'I' || tmp_str[i] == 'i'){// infrared
             int sensor_index;
             sscanf(tmp_str + i + 1, "%d", &sensor_index);
-            int sensor_value = infrared_sensors_control->get_distance(sensor_index);
+            int sensor_value = infrared_sensors_controller.get_distance(sensor_index);
             sprintf(serial_out, "I%d %d#", sensor_index, sensor_value);
             i += 2;
           }

#include "infrared_sensors_controller.h"
//#include "MemoryFree.h"

//byte potentiometers_pins[4] = {0, 1, 2, 3};
//t_limit_pair potentiometer_limits[4] = {{500, 1000, 500}, {500, 1023, 500}, {200, 600, 400}, {300, 600, 500}};

byte infrared_pins[2] = {52, 53};

t_motors_controller motors_controller;
t_potentiometers_controller potentiometers_controller;
t_ultrasonic_sensors_controller ultrasonic_sensors_controller;
t_infrared_sensors_controller *infrared_sensors_control;

char is_command_running;


                 sprintf(serial_out, "CP#");
                 i += num_consumed_total;
               }
             else
               if (tmp_str[i + 1] == 'I' || tmp_str[i + 1] == 'i'){// create a list of infrared sensors
               
                 int num_infrareds = 0;
                 
                 int num_consumed = 0;
                 sscanf(tmp_str + i + 3, "%d%n", &num_infrareds, &num_consumed);
                 
                 int num_consumed_total = 3 + num_consumed;
                 infrared_sensors_controller.set_num_sensors(num_infrareds);
                 for (int k = 0; k < num_infrareds; k++){
                   int _out_pin;
                   int _low;
                   sscanf(tmp_str + i + num_consumed_total, "%d%d%n", &_out_pin, &_low, &num_consumed);
                   infrared_sensors_controller.set_params(k, _out_pin, _low);
                   num_consumed_total += num_consumed + 1;
                 }
                 sprintf(serial_out, "CI#");
                 i += num_consumed_total;
               }
         }
    }
    else
