SunSPOT API V2.0


com.sun.spot.sensorboard.peripheral
Interface ISwitch

All Known Implementing Classes:
Switch

public interface ISwitch

Represents a simple pushbutton switch


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.
 

Method Detail

isOpen

boolean isOpen()
Answer true if the switch is NOT pressed

Returns:
true if the switch is NOT pressed

isClosed

boolean isClosed()
Answer true if the switch IS pressed

Returns:
true if the switch IS pressed

waitForChange

void waitForChange()
Block the current thread until the switch's state changes. Note that this function may use a polling implementation that prevents deep sleep. To avoid this, use EDemoBoard.waitForPinChange().


SunSPOT API V2.0


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