function endPos = smoothMove(initPos, endPos, serv, speed)
    if initPos > endPos
        for angle = initPos/180:-speed/180:endPos/180
        writePosition(serv, angle);
        pause(0.05);
        end
    else
        for angle = initPos/180:speed/180:endPos/180
        writePosition(serv, angle);
        pause(0.05);
        end
    end
    
    
end

