function pos = setSpeedReadPos(H,id,speed)

globalVar;

sendServo(H,SET_SPEED_READ_POS,id,speed,0,0,0,0);
[command,return1,return2] = readServo(H);

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

