com.dexterind.gopigo.components
Class Led

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

public class Led
extends java.lang.Object

Handles the LED functions.

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  int id
          The current led id
static int LEFT
          The left pin ID.
private static int LEFT_PIN_A
          The left pin code.
private static int LEFT_PIN_B
          The left pin code.
private  int pin
          The current pin code.
static int RIGHT
          The right pin ID.
private static int RIGHT_PIN_A
          The right pin code.
private static int RIGHT_PIN_B
          The right pin code.
 
Constructor Summary
Led(int id)
           
 
Method Summary
 int off()
          Turns the led OFF.
 int on()
          Turns the led ON.
 void setPin()
          Sets the pin to use for the led.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT_PIN_A

private static final int LEFT_PIN_A
The left pin code.

See Also:
Constant Field Values

RIGHT_PIN_A

private static final int RIGHT_PIN_A
The right pin code.

See Also:
Constant Field Values

LEFT_PIN_B

private static final int LEFT_PIN_B
The left pin code.

See Also:
Constant Field Values

RIGHT_PIN_B

private static final int RIGHT_PIN_B
The right pin code.

See Also:
Constant Field Values

LEFT

public static final int LEFT
The left pin ID.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
The right pin ID.

See Also:
Constant Field Values

board

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


pin

private int pin
The current pin code.


id

private int id
The current led id


debug

private Debug debug
The debug object.

Constructor Detail

Led

public Led(int id)
Method Detail

setPin

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

Parameters:
pin - The number of the pin where the led is attached.

on

public int on()
Turns the led ON.

Returns:
A status code.
Throws:
java.io.IOException

off

public int off()
Turns the led OFF.

Returns:
A status code.
Throws:
java.io.IOException