Ultrasonic sensor with analogue, switching output