I'm not sure about an analog ultrasonic sensor, but the digital ones require you to tell it when to ping. With the Ultrasonic object, you can turn on an "automatic mode" that will continuously ping.
Code:
us = new Ultrasonic(2,3);
us.setAutomaticMode(true);