function setPosAll(H,pos)

globalVar;

pos = round((((pos+ANGLE_MAX)*VAL_ANGLE_RANGE)/ANGLE_RANGE)+VAL_ANGLE_MIN);
param1 = bitand(pos,MASK_HIGH)/256;  
param2 = bitand(pos,MASK_LOW);
sendServo(H,SET_POS_ALL,param1,param2,0,0,0,0);
[command,return1] = readServo(H);

if(~(command == SET_POS_ALL && return1 == 0))
    disp('OPERATION FAILED: Set Position (All)');
end

