SunSPOT API V6.0


com.sun.spot.sensorboard.peripheral
Class ADT7411Event

java.lang.Object
  extended by com.sun.spot.resources.transducers.SensorEvent
      extended by com.sun.spot.sensorboard.peripheral.ADT7411Event

public class ADT7411Event
extends SensorEvent

Capture the state of an ADT7411 input event so it can be reported to a callback. Used by rev 6 eDemoboard for LightSensor & ScalarInput for thresholdChanged() & thresholdExceeded() callbacks.


Field Summary
protected  int newHighThreshold
           
protected  int newLowThreshold
           
protected  boolean thresholdChanged
           
protected  int value
           
 
Fields inherited from class com.sun.spot.resources.transducers.SensorEvent
sensor, when
 
Constructor Summary
ADT7411Event(ITransducer sensor)
          Constructor
 
Method Summary
 int getHighThreshold()
          Get the new high threshold value.
 int getLowThreshold()
          Get the new low threshold value.
 int getValue()
          Get the event state analog value.
 boolean isThresholdChanged()
          Is this a threshold changed event?
 void setThresholds(int newLow, int newHigh)
          Set the new threshold values.
 void setValue(int value)
          Record the analog value.
 
Methods inherited from class com.sun.spot.resources.transducers.SensorEvent
getSensor, getTime, setTime
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thresholdChanged

protected boolean thresholdChanged

value

protected int value

newLowThreshold

protected int newLowThreshold

newHighThreshold

protected int newHighThreshold
Constructor Detail

ADT7411Event

public ADT7411Event(ITransducer sensor)
Constructor

Parameters:
sensor - the appropriate ScalarInput or LightSensor sensor
Method Detail

setValue

public void setValue(int value)
Record the analog value.

Parameters:
value - the current state

setThresholds

public void setThresholds(int newLow,
                          int newHigh)
Set the new threshold values.

Parameters:
newLow - the new low threshold value
newHigh - the new high threshold value

isThresholdChanged

public boolean isThresholdChanged()
Is this a threshold changed event?

Returns:
if true then a threshold changed event

getValue

public int getValue()
Get the event state analog value.

Returns:
the analog input's value

getLowThreshold

public int getLowThreshold()
Get the new low threshold value.

Returns:
the new low threshold value

getHighThreshold

public int getHighThreshold()
Get the new high threshold value.

Returns:
the new high threshold value

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.