|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.spot.resources.Resource
com.sun.spot.sensorboard.io.BinaryScalar
public class BinaryScalar
Class to allow using a ScalarInput as though it is an GPIO InputPin.
| Constructor Summary | |
|---|---|
BinaryScalar(IScalarInput pin)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addIInputPinListener(IInputPinListener who)
Adds the specified input pin listener to receive callbacks from this input pin. |
void |
addIInputPinListener(IInputPinListener who)
Old style IInputPinListener. |
SensorEvent |
createSensorEvent()
Create a SensorEvent of the appropriate type for this sensor. |
String |
getDescription()
This method returns a readable description of the sensor. |
IInputPinListener[] |
getIInputPinListeners()
Returns an array of all the input pin listeners registered on this input pin. |
PinDescriptor |
getIndex()
|
double |
getMaxSamplingRate()
Return the maximum sampling rate per second for this sensor. |
int |
getRange()
|
int |
getValue()
|
boolean |
isHigh()
Return true if the input bit is high. |
boolean |
isLow()
Return true if the input bit is low. |
void |
removeIInputPinListener(IInputPinListener who)
Removes the specified input pin listener so that it no longer receives callbacks from this input pin. |
void |
removeIInputPinListener(IInputPinListener who)
Old style IInputPinListener. |
void |
saveEventState(SensorEvent evt)
Save the current sensor state in the specified event. |
void |
thresholdChanged(IScalarInput in,
int low,
int high)
Callback for when the scalar input thresholds are changed. |
void |
thresholdExceeded(IScalarInput in,
int val)
Callback for when the scalar input value goes above or below the specified thresholds. |
void |
waitForChange()
Either polls or blocks until interrupt from a-to-d. |
| Methods inherited from class com.sun.spot.resources.Resource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.spot.resources.IResource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Constructor Detail |
|---|
public BinaryScalar(IScalarInput pin)
pin - ScalarInput Pin to use| Method Detail |
|---|
public int getValue()
throws IOException
IOException
public int getRange()
throws IOException
IOExceptionpublic boolean isLow()
IInputPin
isLow in interface IInputPinpublic boolean isHigh()
IInputPin
isHigh in interface IInputPinpublic void waitForChange()
waitForChange in interface IInputPinpublic PinDescriptor getIndex()
public void addIInputPinListener(IInputPinListener who)
addIInputPinListener in interface IInputPinwho - the input pin listener to add.public void removeIInputPinListener(IInputPinListener who)
removeIInputPinListener in interface IInputPinwho - the input pin listener to remove.public IInputPinListener[] getIInputPinListeners()
getIInputPinListeners in interface IInputPinpublic void addIInputPinListener(IInputPinListener who)
public void removeIInputPinListener(IInputPinListener who)
public void thresholdExceeded(IScalarInput in,
int val)
thresholdExceeded in interface IScalarInputThresholdListenerin - the IScalarInput that has crossed a threshold.val - the current scalar input reading.
public void thresholdChanged(IScalarInput in,
int low,
int high)
thresholdChanged in interface IScalarInputThresholdListenerin - the IScalarInput that had its threshold values changed.low - the new scalar input low threshold value.high - the new scalar input high threshold value.public String getDescription()
ITransducer
getDescription in interface ITransducerpublic double getMaxSamplingRate()
ITransducer
getMaxSamplingRate in interface ITransducerpublic SensorEvent createSensorEvent()
ITransducer
createSensorEvent in interface ITransducerpublic void saveEventState(SensorEvent evt)
ITransducer
saveEventState in interface ITransducerevt - the event to store the sensor state in
|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||