Configuring a distance sensor