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.
| | Object | Size | Description | A1 | A2 | B1 | B2 | C1 |
 | oLED2 | 8 Bytes | Controls a Dual Color LED light with brightness control. | x | x | x |
|
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. |
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 |
|
|
|
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 | |
|
Connections: |
| 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. |
 |  |
|
Related Items:
|
| | The following table lists objects with related functions
| | Object | Description | A1 | A2 | B1 | B2 | C1 |
 | o8bar | Controls an 8-Segment Bar Display. | x |
 | oChaser4 | Controls a series of chasing lights. | x | x |
 | oLED | Controls an LED light with brightness control. | x | x | x |
 | oLEDB | Controls an LED light with blinking functions. | x | x |
 | oLight | Controls a light. | x | x | x |
|
Version History and Bug List: |
| | Firmware Ver B1: Introduced. Firmware Ver C1: Invert property added in the LED Objects.Bugs: No known bugs. |