|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.phidgets.Phidget
com.phidgets.WeightSensorPhidget
public final class WeightSensorPhidget
This class represents a Phidget Weight Sensor. All methods to read weight data from the weight sensor are implemented in this class.
The Phidget Weight Sensor is simply an electronic scale with a USB interface. It provides one weight value, in kg.
Constructor Summary | |
---|---|
WeightSensorPhidget()
|
Method Summary | |
---|---|
void |
addWeightChangeListener(WeightChangeListener l)
Adds a weight change listener. |
double |
getWeight()
Returns the sensed weight in kg. |
double |
getWeightChangeTrigger()
Returns the weight change trigger. |
void |
removeWeightChangeListener(WeightChangeListener l)
|
void |
setWeightChangeTrigger(double newVal)
Sets the weight 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 |
---|
public WeightSensorPhidget() throws PhidgetException
PhidgetException
Method Detail |
---|
public double getWeight() throws PhidgetException
PhidgetException
- If this Phidget is not opened and attached.
See open
for information on determining if a device is attached.public void setWeightChangeTrigger(double newVal) throws PhidgetException
newVal
- The new trigger value
PhidgetException
- If this Phidget is not opened and attached.
See open
for information on determining if a device is attached.public double getWeightChangeTrigger() throws PhidgetException
PhidgetException
- If this Phidget is not opened and attached.
See open
for information on determining if a device is attached.public final void addWeightChangeListener(WeightChangeListener l)
Trigger
that has been set.
There is no limit on the number of weight change handlers that can be registered for a particular Phidget.
l
- An implemetation of the WeightChangeListener
interfacepublic final void removeWeightChangeListener(WeightChangeListener l)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |