ioio.lib.impl
Class DigitalInputImpl
java.lang.Object
ioio.lib.impl.AbstractResource
ioio.lib.impl.AbstractPin
ioio.lib.impl.DigitalInputImpl
- All Implemented Interfaces:
- Closeable, DigitalInput
public class DigitalInputImpl
- extends AbstractPin
- implements DigitalInput
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
setValue
public void setValue(int value)
waitForValue
public void waitForValue(boolean value)
throws java.lang.InterruptedException,
ConnectionLostException
- Description copied from interface:
DigitalInput
- Block until a desired logical level is sensed. The calling thread can be
interrupted for aborting this operation.
- Specified by:
waitForValue
in interface DigitalInput
- Parameters:
value
- The desired logical level. true for "HIGH", false for "LOW".
- Throws:
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO has been lost.
close
public void close()
- Specified by:
close
in interface Closeable
- Overrides:
close
in class AbstractPin
read
public boolean read()
throws java.lang.InterruptedException,
ConnectionLostException
- Description copied from interface:
DigitalInput
- Read the value sensed on the pin. May block for a few milliseconds if
called right after creation of the instance. If this is a problem, the
calling thread may be interrupted.
- Specified by:
read
in interface DigitalInput
- Returns:
- True for logical "HIGH", false for logical "LOW".
- Throws:
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO has been lost.
disconnected
public void disconnected()
- Overrides:
disconnected
in class AbstractResource