# File lib/sensors/ultrasonic_sensor.rb, line 24
  def initialize(nxt, port = NXTComm::SENSOR_4)
    super(nxt, port)
    
    # The Ultrasonic sensor is digital and unlike the other sensors it
    # uses the lowspeed communication protocol.
    set_input_mode(NXTComm::LOWSPEED_9V, NXTComm::RAWMODE)
    
    # Read the sensor in case there was some garbage data in the buffer waiting to be read
    @nxt.ls_read(@port)
    
    # Set the sensor to continuously send pings
    @nxt.ls_write(@port, UltrasonicComm.continuous_measurement_command)
  end