ch.aplu.ftcontroller
Class DigitalIn

java.lang.Object
  extended by ch.aplu.ftcontroller.DigitalIn

public class DigitalIn
extends java.lang.Object

A class the represents the digital input ports (I1..I8).


Method Summary
 int getValue()
          Polls the digital input ports (all 8 at the same time) and returns their states as a bit pattern: I1->bit 0 (LSB),...
 boolean isPortOff(int portNb)
          Polls the digital input ports (all 8 at the same time) and returns true if the specified port is turned off.
 boolean isPortOn(int portNb)
          Polls the digital input ports (all 8 at the same time) and returns true if the specified port is turned on.
 void waitPortOff(int portNb)
          Wait until the specified port is set to 0.
 void waitPortOn(int portNb)
          Wait until the specified port is set to 1.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getValue

public int getValue()
Polls the digital input ports (all 8 at the same time) and returns their states as a bit pattern: I1->bit 0 (LSB),...,I8->bit 7 (MSB), higher bits set to zero.

Returns:
a bit pattern of the port states (integer 0..255)

isPortOn

public boolean isPortOn(int portNb)
Polls the digital input ports (all 8 at the same time) and returns true if the specified port is turned on.

Parameters:
portNb - the port number 1..8
Returns:
true, if the port is set to 1; false, if set to 0

isPortOff

public boolean isPortOff(int portNb)
Polls the digital input ports (all 8 at the same time) and returns true if the specified port is turned off.

Parameters:
portNb - the port number 1..8
Returns:
true, if the port is set to 0; false, if set to 1

waitPortOn

public void waitPortOn(int portNb)
Wait until the specified port is set to 1.

Parameters:
portNb - the port number 1..8

waitPortOff

public void waitPortOff(int portNb)
Wait until the specified port is set to 0.

Parameters:
portNb - the port number 1..8