|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IScalarInput
IScalarInput provides access to the values returned by an analogue input device.
The value range is from zero to the value returned by getRange()
Method Summary | |
---|---|
void |
addIScalarInputThresholdListener(IScalarInputThresholdListener who)
Adds the specified scalar input threshold listener to receive callbacks from this input device. |
boolean |
areThresholdEventsEnabled()
Return whether threshold events are enabled or not. |
void |
enableThresholdEvents(boolean enable)
Enable or disable threshold events. |
int |
getHighThreshold()
Return the current high threshold value. |
PinDescriptor |
getIndex()
Return the PinDescriptor associated with this input pin. |
IScalarInputThresholdListener[] |
getIScalarInputThresholdListeners()
Returns an array of all the scalar input threshold listeners registered on this input device. |
int |
getLowThreshold()
Return the current low threshold value. |
int |
getRange()
Return the maximum possible value that could be returned from the input device. |
int |
getValue()
Return the current value of the input. |
void |
removeIScalarInputThresholdListener(IScalarInputThresholdListener who)
Removes the specified scalar input threshold listener so that it no longer receives callbacks from this input device. |
void |
setThresholds(int low,
int high)
Set the low and high threshold values for this scalar input. |
boolean |
supportsThresholdEvents()
Returns whether the underlying hardware supports threshold events. |
Method Detail |
---|
PinDescriptor getIndex()
int getRange() throws IOException
IOException
int getValue() throws IOException
IOException
boolean supportsThresholdEvents()
void addIScalarInputThresholdListener(IScalarInputThresholdListener who)
who
- the light sensor threshold listener to add.void removeIScalarInputThresholdListener(IScalarInputThresholdListener who)
who
- the scalar input threshold listener to remove.IScalarInputThresholdListener[] getIScalarInputThresholdListeners()
void setThresholds(int low, int high)
low
- the new low threshold value.high
- the new high threshold value.int getLowThreshold()
int getHighThreshold()
void enableThresholdEvents(boolean enable)
enable
- if true then listeners will be notified if the scalar input
reading goes above the high threshold or below the low threshold.boolean areThresholdEventsEnabled()
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |