peripherals
Class LED

java.lang.Object
  extended by peripherals.LED

public class LED
extends java.lang.Object

This class is created in order to keep the information of a single LED.

Since:
22.04.2007
Author:
maho

Field Summary
 boolean bit
          LED data
 
Constructor Summary
LED(int ledId)
          Constructor with default values.
LED(int ledId, Register ledData, boolean isEnabled)
          Main constructor of the LED class.
 
Method Summary
 int getLedId()
           
 boolean isEnabled()
           
 byte readData()
          A LED doesn't have a register to hold its data.
 void setEnabled(boolean isEnabled)
           
 void setLedId(int ledId)
           
 void update()
          This methods alters the corresponding LED element in the virtual card.
 void writeData(byte ledData)
          A LED doesn't have a register to hold its data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bit

public boolean bit
LED data

Constructor Detail

LED

public LED(int ledId)
Constructor with default values. Id should be specified.

Parameters:
ledId - instance-unique id
Since:
19.01.2007

LED

public LED(int ledId,
           Register ledData,
           boolean isEnabled)
Main constructor of the LED class.

Parameters:
ledId - instance-unique id
ledData - initial data to be loaded
isEnabled - status of LED
Since:
19.01.2007
Method Detail

update

public void update()
This methods alters the corresponding LED element in the virtual card. Setting enable/disable mode is performed by SevenSegmentDisplayArray object.

Since:
19.01.2007

isEnabled

public boolean isEnabled()
Returns:
the isEnabled
Since:
19.01.2007

setEnabled

public void setEnabled(boolean isEnabled)
Parameters:
isEnabled - the isEnabled to set
Since:
19.01.2007

readData

public byte readData()
A LED doesn't have a register to hold its data. It reads the data from PIC ports (PORTD) and gives output only if it is enabled.

Returns:
the ssData
Since:
19.01.2007

writeData

public void writeData(byte ledData)
A LED doesn't have a register to hold its data. It writes the data from PIC ports (PORTD) and gives output only if it is enabled.

Parameters:
ledData - the ssData to set
Since:
19.01.2007

getLedId

public int getLedId()
Returns:
the ledId
Since:
19.01.2007

setLedId

public void setLedId(int ledId)
Parameters:
ledId - the ledId to set
Since:
19.01.2007