|
SunSPOT API V2.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.spot.sensorboard.peripheral.Switch
public class Switch
Class implementing simple switches, assuming a mapping of open=LOW, closed=HIGH. If the sense of the switch is reversed compose an InvertingSingleBitInput onto the pin input.
| Constructor Summary | |
|---|---|
Switch(IInputPin input)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
isClosed()
Answer true if the switch IS pressed |
boolean |
isOpen()
Answer true if the switch is NOT pressed |
void |
waitForChange()
Block the current thread until the switch's state changes. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Switch(IInputPin input)
input - the single-bit input to be used| Method Detail |
|---|
public boolean isOpen()
ISwitch
isOpen in interface ISwitchpublic boolean isClosed()
ISwitch
isClosed in interface ISwitchpublic void waitForChange()
ISwitchEDemoBoard.waitForPinChange().
waitForChange in interface ISwitchISwitch.waitForChange()
|
SunSPOT API V2.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||