com.dexterind.gopigo.components
Class IRReceiverSensor

java.lang.Object
  extended by com.dexterind.gopigo.components.IRReceiverSensor

public class IRReceiverSensor
extends java.lang.Object

It get access to the IR receiver sensor and receive IR signals

Author:
marcello

Field Summary
private static Board board
          The main object which handles the methods to get access to the resources connected to the board.
private  Debug debug
          The debug object.
private static IRReceiverSensor instance
          The instance of the current object.
private  int pin
          The current pin.
 
Constructor Summary
IRReceiverSensor()
           
 
Method Summary
static IRReceiverSensor getInstance()
          Provides a global point of access to the UltraSonicSensor instance.
 byte[] read()
          Reads the IR signal.
 void setPin(int pin)
          Sets the pin to use for the sensor.
 int write(int value)
          Prepare the IR receiver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

board

private static Board board
The main object which handles the methods to get access to the resources connected to the board.


instance

private static IRReceiverSensor instance
The instance of the current object.


pin

private int pin
The current pin. It can be configured through the setPin() method.


debug

private Debug debug
The debug object.

Constructor Detail

IRReceiverSensor

public IRReceiverSensor()
                 throws java.io.IOException,
                        java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException
Method Detail

getInstance

public static IRReceiverSensor getInstance()
                                    throws java.io.IOException,
                                           java.lang.InterruptedException
Provides a global point of access to the UltraSonicSensor instance.

Returns:
the UltraSonicSensor instance.
Throws:
java.io.IOException
java.lang.InterruptedException

setPin

public void setPin(int pin)
Sets the pin to use for the sensor.

Parameters:
pin - The number of the pin where the sensor is attached. The given value is increased by one.

read

public byte[] read()
            throws java.io.IOException
Reads the IR signal.

Returns:
The bytes coming from the sensor.
Throws:
java.io.IOException

write

public int write(int value)
          throws java.io.IOException
Prepare the IR receiver

Returns:
True or False.
Throws:
java.io.IOException