oLED2 Object

Back to top of page Description:
 An oLED2 Object is a Hardware Object that uses two digital I/O lines to control the brightness of a Dual Color LED.

The brightness of each color of the LED is controlled by a single value with a range of 0 to 15.  When this value is 0, the LED is off. When the value is a number from 1 to 15, the LED increases in brightness at a level indicated by the value.  The higher the value, the brighter the LED is. 

Using combinations of brightness, blends of color can be achieved.

 The following table lists the size and availability of the oLED2 Object.
 ObjectSizeDescriptionA1A2B1B2C1
oLED28 BytesControls a Dual Color LED light with brightness control.xxx
Back to top of page Operation:
 An oLED2 Object synchronizes the control signals of two oLED objects in such a way that the brightness of each can be used to blend the two colors of a Dual Color LED.

Other than being synchronized, each oLED object operates independently and each has its own properties and methods.

There are two types of Dual LEDs.

  • The first has two LEDs with a single common lead.  The polarity of the two internal LEDs is arranged so that both LEDs can be on at the same time. 
  • The second type has two common leads.  The polarity of the two internal LEDs opposite each other.  With this arrangement, only one LED can be on at any time.

When using the first type, the oLED objects can be operated without any consideration for what the other one is doing.  However, when the second type is being used.  One of the two oLED object will need its Invert property to be set to 1.  This will allow that oLED object to work with the necessary reversed electrical connection.

Back to top of page Properties:

The following table lists the properties of the oLED2 Object:

Property

Description

A
The LED object used to control the LED.
Object Class: oLED Value Range: 0 - 15
Data Type: Numeric Default Value: 0
B
The LED object used to control the LED.
Object Class: oLED Value Range: 0 - 15
Data Type: Numeric Default Value: 0
Address
Returns a pointer to the address of the oCounter Object instance.
Object Class: oAddress Value Range: 0 - 127
Data Type:Pointer (Read Only) Default Value: Address of Object

Back to top of page Example:

The following examples use the oLED2 Object.
Visual Basic Syntax C and Java Syntax
Dim L As New oLED2

Sub Main()
  L.A.IOLine = 9
  L.B.IOLine = 11
  Do
    L.A.Flash
    L.B.Flash
  Loop  
End Sub 
oLED2 l = New oLED2;

Void Main(Void){
  l.A.IOLine = 9;
  l.B.IOLine = 11;
  Do{
    l.A.Flash
    l.B.Flash
  } While (1)  
}
Basic Syntax 
L As oLED2
L.A.IOLine = 9
L.B.IOLine = 11
Do
  L.A.Flash
  L.B.Flash
Loop  
 
Back to top of pageConnections:
In a Dual color LED, the IOLine property of each LED specifies which I/O Line to connect to its respective side of the dual color LED.

There are two types of Dual LEDs. The first has two LEDs with a single common lead.  The polarity of the two internal LEDs is arranged so that both LEDs can be on at the same time.  The second type has two common leads.  The polarity of the two internal LEDs opposite each other.  With this arrangement, only one LED can be on at any time.

Note that LEDs are polarized. That is to say, they will not work if it is connected backwards. Make sure that you have attached the LED with the positive side (long prong) connecting to the I/O line and the negative side (short prong) connecting to the resistor.

Dual LEDs with one common lead.Dual LEDs with two common leads.

Back to top of page Related Items:

 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
o8barControls an 8-Segment Bar Display.x
oChaser4Controls a series of chasing lights.xx
oLEDControls an LED light with brightness control.xxx
oLEDBControls an LED light with blinking functions.xx
oLightControls a light.xxx
Back to top of page Version History and Bug List:
 Firmware Ver B1: Introduced.
Firmware Ver C1: Invert property added in the LED Objects.

Bugs: No known bugs.


ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.