SunSPOT API V3.0


com.sun.spot.sensorboard.capabilities
Interface IADCController

All Known Implementing Classes:
EDemoController

public interface IADCController

Controller interface of an Analog to Digital Convertor controller.

Author:
arshan & Ron Goldman

Method Summary
 boolean areThresholdEventsEnabled(IScalarInput pin)
          Return whether threshold events are enabled or disabled.
 void enableThresholdEvents(IScalarInput pin, boolean enable)
          Enable or disable threshold events.
 int getHighThreshold(IScalarInput pin)
          Return the current high threshold value.
 int getLowThreshold(IScalarInput pin)
          Return the current low threshold value.
 int getScalarValue(PinDescriptor pidx)
          Return current value of scalar input idx meant to be used only by the accessor objects.
 void setThresholdValues(IScalarInput pin, int low, int high)
          Set the low and high threshold values for this scalar input.
 boolean supportsThresholdEvents(PinDescriptor pidx)
          Returns whether the underlying hardware supports threshold events.
 

Method Detail

getScalarValue

int getScalarValue(PinDescriptor pidx)
Return current value of scalar input idx meant to be used only by the accessor objects.

Parameters:
pidx - pin to be read
Returns:
current scalar value of pin

supportsThresholdEvents

boolean supportsThresholdEvents(PinDescriptor pidx)
Returns whether the underlying hardware supports threshold events.

Returns:
true if threshold events are supported

setThresholdValues

void setThresholdValues(IScalarInput pin,
                        int low,
                        int high)
Set the low and high threshold values for this scalar input. Callbacks occur when the scalar input reading falls below or equal to the low threshold value, or when it rises above or equal to the high threshold value.

Parameters:
pin - pin to be read
low - the new low threshold value.
high - the new high threshold value.

getLowThreshold

int getLowThreshold(IScalarInput pin)
Return the current low threshold value.

Parameters:
pin - pin to be read
Returns:
the current low threshold value.

getHighThreshold

int getHighThreshold(IScalarInput pin)
Return the current high threshold value.

Parameters:
pin - pin to be read
Returns:
the current high threshold value.

enableThresholdEvents

void enableThresholdEvents(IScalarInput pin,
                           boolean enable)
Enable or disable threshold events.

Parameters:
pin - pin to be read
enable - if true then listeners will be notified if the scalar input reading goes above the high threshold or below the low threshold.

areThresholdEventsEnabled

boolean areThresholdEventsEnabled(IScalarInput pin)
Return whether threshold events are enabled or disabled.

Parameters:
pin - pin to be read
Returns:
true if events are enabled

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.