Class DACTA70909Controller

java.lang.Object
  extended by DACTA70909Controller

public class DACTA70909Controller
extends java.lang.Object


Constructor Summary
DACTA70909Controller()
           
 
Method Summary
 java.lang.String errorString(int errorcode)
          Used to convert an error code into a description.
 int getSensorValue(int sensornumber)
          Returns the raw value of a sensor output.
 byte getStatusValue(int sensornr)
          Returns the 6 bit status value of a sensor output.
 int init(java.lang.String port)
          Used to tell the controller which port to use and start the controller.
 void serialEvent(SerialPortEvent event)
           
 int setOutPut(int port, boolean on, boolean right)
          To turn a port on/off etc.
 int setPower(int outputnr, int value)
          Sets the power of an ouput.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DACTA70909Controller

public DACTA70909Controller()
Method Detail

init

public int init(java.lang.String port)
Used to tell the controller which port to use and start the controller.

Parameters:
port - Port name. Use "COM1" or "COM2" on most windows machines.
Returns:
Errorcode if something went wrong, else 0

getSensorValue

public int getSensorValue(int sensornumber)
Returns the raw value of a sensor output.

Parameters:
sensornumber - The sensor (0-7)
Returns:
The value (0-1023)

getStatusValue

public byte getStatusValue(int sensornr)
Returns the 6 bit status value of a sensor output.

Parameters:
sensornr -
Returns:
The value (0-63)

setOutPut

public int setOutPut(int port,
                     boolean on,
                     boolean right)
To turn a port on/off etc.

Parameters:
port - The port (0-7) to be set.
on - on/off (true = on, false = off)
right - (true = set port to right, false = set port to left.)
Returns:
Error code if something went wrong, else 0

setPower

public int setPower(int outputnr,
                    int value)
Sets the power of an ouput. Setting power turns the output off. This is due to the way the DACTA70909 works.

Parameters:
outputnr - The output to be set 0-7
value - The power to set 0-8
Returns:
Error code if something went wrong, else 0

errorString

public java.lang.String errorString(int errorcode)
Used to convert an error code into a description.

Parameters:
errorcode -
Returns:
A string describing the meaning of the errorcode.

serialEvent

public void serialEvent(SerialPortEvent event)