function pos = readPos(H)

globalVar;
pos = 255;

sendServo(H,READ_POS,0,0,0,0,0,0);
[command,return1,return2] = readServo(H);

if(command == READ_POS)
    pos = (return1*256) + return2;
    pos = (((pos-VAL_ANGLE_MIN)*ANGLE_RANGE)/VAL_ANGLE_RANGE)+ANGLE_MIN;
else
    disp('OPERATION FAILED: Read Position');
end

