function [posArray,t] = readAllPtP(H,return1,return2,return3)

globalVar;
posArray = zeros(3,800);
t = zeros(1,800);

i=0;
while (return1 ~= 1 || return2 ~= 2 || return3 ~= 3)
    i = i+1;
    [command,return1,return2,return3] = readServo(H);
    posArray(1,i) = return1*256 + return2;
    ret = return3;
    [command,return1,return2,return3] = readServo(H);
    posArray(2,i) = ret*256 + return1;
    posArray(3,i) = return2*256 + return3;
    [command,return1,return2,return3] = readServo(H);
    t(1,i)=return1*256+return2;
end

[command,return1,return2,return3] = readServo(H);       % Não preciso desta
N = (return1*256) + return2;                            % leitura porque
disp(['Movement with ', num2str(N), ' values.']);       % N = i-1;
% disp(['Movement with ', num2str(i-1), ' values.']);

for i=1:N
    for j=1:3
        posArray(j,i) = (((posArray(j,i)-VAL_ANGLE_MIN)*ANGLE_RANGE)/VAL_ANGLE_RANGE)+ANGLE_MIN;
%         if(j==1)
%             posArray(j,i)=-posArray(j,i)/4;
%         end
%         if(j==2)
%             posArray(j,i)=posArray(j,i)/4;
%         end
%         if(j==3)
%             posArray(j,i)=(-posArray(j,i)-90)/(30/22);
%         end
    end
end

posArray = posArray(:,1:N);
t = t(1,1:N);

end