com.phidgets
Class PHSensorPhidget

java.lang.Object
  extended by com.phidgets.Phidget
      extended by com.phidgets.PHSensorPhidget

public final class PHSensorPhidget
extends Phidget

This class represents a Phidget PH Sensor. All methods to read PH data from the PH Sensor are implemented in this class.

The Phidget PH Sensor provides one standard PH sensor input.


Constructor Summary
PHSensorPhidget()
           
 
Method Summary
 void addPHChangeListener(PHChangeListener l)
          Adds a pH change listener.
 double getPH()
          Returns the measured pH.
 double getPHChangeTrigger()
          Returns the change trigger.
 double getPotential()
          Returns the Potential, in volts.
 void removePHChangeListener(PHChangeListener l)
           
 void setPHChangeTrigger(double newVal)
          Sets the change trigger.
 
Methods inherited from class com.phidgets.Phidget
addAttachListener, addDetachListener, addErrorListener, close, equals, getDeviceName, getDeviceType, getDeviceVersion, getLibraryVersion, getSerialNumber, getTag, isAttached, open, openAny, removeAttachListener, removeDetachListener, removeErrorListener, setTag, toString, waitForAttachment
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PHSensorPhidget

public PHSensorPhidget()
                throws PhidgetException
Throws:
PhidgetException
Method Detail

getPH

public double getPH()
             throws PhidgetException
Returns the measured pH. This value can range from about 0 - 14 for valid readings when the sensor is attached.

Returns:
the current pH
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getPotential

public double getPotential()
                    throws PhidgetException
Returns the Potential, in volts. This returns the actual voltage potential measured by the A/D A pH of 7.0 corresponts to a potential of 2.5v. This si the value that is internally used to calculate pH in the library.

Returns:
the current potential
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

setPHChangeTrigger

public void setPHChangeTrigger(double newVal)
                        throws PhidgetException
Sets the change trigger. This is how much the pH much change between successive PHChangeEvents. By default this value is set to 0.5

Parameters:
newVal - Trigger
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

getPHChangeTrigger

public double getPHChangeTrigger()
                          throws PhidgetException
Returns the change trigger. This is how much the pH much change between successive PHChangeEvents. By default this value is set to 0.5

Returns:
Trigger
Throws:
PhidgetException - If this Phidget is not opened and attached. See open for information on determining if a device is attached.

addPHChangeListener

public final void addPHChangeListener(PHChangeListener l)
Adds a pH change listener. The ph change handler is a method that will be called when the pH has changed by at least the Trigger that has been set.

There is no limit on the number of ph change handlers that can be registered for a particular Phidget.

Parameters:
l - An implemetation of the PHChangeListener interface

removePHChangeListener

public final void removePHChangeListener(PHChangeListener l)