function nServosMove(H)

globalVar;

disp(' ');
nServos = input('Number of Servos to move: ');
sendServo(H,N_SERV,nServos,0,0,0,0,0);

ServX=zeros(2,12);      % apenas para limpar os valores
disp(' ');
disp('Which you want to move.');
for i= 1:nServos
    ServX(1,i) = (input('  Servo   [0 11]  : '))+1;
    ServX(2,i) = input(' Position [-90 90]: ');
end

% Enviar os IDs
sendServo(H,N_SERV,ServX(1,1),ServX(1,2),ServX(1,3),ServX(1,4),ServX(1,5),ServX(1,6));
[command,return1] = readServo(H);
if(~(command == N_SERV && return1 == 2))
    disp('OPERATION FAILED: IDs [0 5] are not store');
end
sendServo(H,N_SERV,ServX(1,7),ServX(1,8),ServX(1,9),ServX(1,10),ServX(1,11),ServX(1,12));
[command,return1] = readServo(H);
if(~(command == N_SERV && return1 == 3))
    disp('OPERATION FAILED: IDs [6 11] are not store');
end

% Enviar as Posições
pos0 = ServX(2,1);
pos0 = round((((pos0+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
param1 = bitand(pos0,MASK_HIGH) / 256;
param2 = bitand(pos0,MASK_LOW);
pos1 = ServX(2,2);
pos1 = round((((pos1+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
param3 = bitand(pos1,MASK_HIGH) / 256;
param4 = bitand(pos1,MASK_LOW);
pos2 = ServX(2,3);
pos2 = round((((pos2+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
param5 = bitand(pos2,MASK_HIGH) / 256;
param6 = bitand(pos2,MASK_LOW);

sendServo(H,N_SERV,param1,param2,param3,param4,param5,param6);            
[command,return1] = readServo(H);
if(~(command == N_SERV && return1 == 1))
    disp('OPERATION FAILED: Set Position N_SERV part1');
end

if (nServos > 3)
    pos0 = ServX(2,4);
    pos0 = round((((pos0+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
    param1 = bitand(pos0,MASK_HIGH) / 256;
    param2 = bitand(pos0,MASK_LOW);
    pos1 = ServX(2,5);
    pos1 = round((((pos1+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
    param3 = bitand(pos1,MASK_HIGH) / 256;
    param4 = bitand(pos1,MASK_LOW);
    pos2 = ServX(2,6);
    pos2 = round((((pos2+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
    param5 = bitand(pos2,MASK_HIGH) / 256;
    param6 = bitand(pos2,MASK_LOW);

    sendServo(H,N_SERV,param1,param2,param3,param4,param5,param6);            
    [command,return1] = readServo(H);
    if(~(command == N_SERV && return1 == 2))
        disp('OPERATION FAILED: Set Position N_SERV part2');
    end
end

if (nServos > 6)
    pos0 = ServX(2,7);
    pos0 = round((((pos0+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
    param1 = bitand(pos0,MASK_HIGH) / 256;
    param2 = bitand(pos0,MASK_LOW);
    pos1 = ServX(2,8);
    pos1 = round((((pos1+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
    param3 = bitand(pos1,MASK_HIGH) / 256;
    param4 = bitand(pos1,MASK_LOW);
    pos2 = ServX(2,9);
    pos2 = round((((pos2+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
    param5 = bitand(pos2,MASK_HIGH) / 256;
    param6 = bitand(pos2,MASK_LOW);

    sendServo(H,N_SERV,param1,param2,param3,param4,param5,param6);            
    [command,return1] = readServo(H);
    if(~(command == N_SERV && return1 == 3))
        disp('OPERATION FAILED: Set Position N_SERV part3');
    end
end

if (nServos > 9)
    pos0 = ServX(2,10);
    pos0 = round((((pos0+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
    param1 = bitand(pos0,MASK_HIGH) / 256;
    param2 = bitand(pos0,MASK_LOW);
    pos1 = ServX(2,11);
    pos1 = round((((pos1+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
    param3 = bitand(pos1,MASK_HIGH) / 256;
    param4 = bitand(pos1,MASK_LOW);
    pos2 = ServX(2,12);
    pos2 = round((((pos2+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
    param5 = bitand(pos2,MASK_HIGH) / 256;
    param6 = bitand(pos2,MASK_LOW);

    sendServo(H,N_SERV,param1,param2,param3,param4,param5,param6);            
    [command,return1] = readServo(H);
    if(~(command == N_SERV && return1 == 4))
        disp('OPERATION FAILED: Set Position N_SERV part4');
    end
end

disp(' ');
disp(['  Servo   : ', num2str(ServX(1,1:nServos)-1)]);
disp([' Position : ', num2str(ServX(2,1:nServos))]);

end