package lejos.nxt;

/*
 * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS.
 * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT.
 */

/**
 * Abstraction for a NXT sound sensor.
 * 
 */
public class SoundSensor extends AnalogSensor implements SensorConstants {
	
	/**
	 * Create a sound sensor object attached to the specified open port.
	 * This sensor will not be configured. All configuration of the sensor port
	 * must be made externally.
	 * @param port open analog sensor port.
	 */
	public SoundSensor(AnalogPort port)
	{
	    super(port);
	    this.port.setTypeAndMode(
               (dba ? TYPE_SOUND_DBA
                    : TYPE_SOUND_DB),
               MODE_PCTFULLSCALE);   
	}

	/**
	 * Create a sound sensor. The sensor will be set to operate in DB mode
	 * @param port the sensor port to use
	 */
	public SoundSensor(Port port)
	{
	    this(port, false);
	}
	/**
	 * Create a sound sensor object attached to the specified port,
	 * and sets DB or DBA mode.
	 * @param port port, e.g. Port.S1
	 * @param dba true to set DBA mode, false for DB mode.
	 */
	public SoundSensor(Port port, boolean dba)
	{
	   super(port);
       this.port.setTypeAndMode(
    		   (dba ? TYPE_SOUND_DBA
    				: TYPE_SOUND_DB),
    		   MODE_PCTFULLSCALE);   
	}
	
	/**
	 * Set DB or DBA mode.
	 * @param dba true to set DBA mode, false for DB mode.
	 */
	public void setDBA(boolean dba)
	{
	    port.setType((dba ? TYPE_SOUND_DBA
	    				  : TYPE_SOUND_DB));
	}

	/**
	 * Read the current sensor value.
	 * @return value as a percentage.
	 */
	public int readValue()
	{
		return ((1023 - port.readRawValue()) * 100/ 1023);  
	}
}

@@ -392,155 +392,137 @@
 port
-.
+,
 %0A%09 * 
-This sensor will not be configured. All configuration of the sensor port%0A%09 * must be made externally.%0A%09 * @param port open analog sensor port
+and sets DB or DBA mode.%0A%09 * @param port open analog sensor port.%0A     * @param dba true to set DBA mode, false for DB mode
 .%0A%09 
@@ -551,32 +551,45 @@
 (AnalogPort port
+, boolean dba
 )%0A%09%7B%0A%09    super(

Fix bug introduced by previous edit.