Component: LED (Generic, RGB) (Outputs: LEDs)
Author | Matrix Ltd |
Version | 1.3 (Release) |
Category | Outputs: LEDs |
Contents
LED (Generic, RGB) component
An LED with red, green and blue elements that can be mixed together to produce almost any colour at any brightness.
This component can be used as a base to create child components
The component LED (RGB, PCB) is inherited from this.
Examples
No additional examples
Downloadable macro reference
Disable
Disables the RGB LED. It will no longer respond to color changes.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Enable
Enables the RGB LED. This must be done before the LED can be lit or the color changed.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Tick
Call this macro at regular intervals to illuminate the LED with the chosen color.
Turns each pin on and off to generate a simple PWM signal for each color - when done rapidly, this gives the illusion of the chosen color.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
SetColor
Set the target color for the LED. Each of the Red, Blue and Green channels can be set to any value from 0 (off) to 255 (full brightness).
Parameters
- BYTE red
- Red component of RGB LED local to this macro
- BYTE green
- Green component of RGB LED local to this macro
- BYTE blue
- Blue component of RGB LED local to this macro
Return value
- This call does not return a value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Red
This property is of type Single digital pin and can be referenced with the variable name red_pin.
Pin that the red LED is connected to.
Green
This property is of type Single digital pin and can be referenced with the variable name green_pin.
Pin that the green LED is connected to.
Blue
This property is of type Single digital pin and can be referenced with the variable name blue_pin.
Pin tha the Blue pin is connected to.
Polarity
This property is of type Fixed list of ints and can be referenced with the variable name polarity.
Active High: Use for common cathode LEDs - Pin true = LED On.
Active Low: Use for common anode LEDs - Pin false = LED On.
Color bit size
This property is of type Fixed list of ints and can be referenced with the variable name colorbitsize.
Color bit depth. Sets the resolution of the virtual PWM signals driving the LEDs.
Lower values mean that the 'Tick' macro can be called less often, but reduced the number of
colours that can be created.
Rollover value
This property is of type Signed integer and can be referenced with the variable name rollover.
The number of unique colours each R/G/B channel can output.
Range: 0 to (Rollover Value - 1).
Target
This property is of type Panel object and can be referenced with the variable name target.
Create custom LED shapes by pointing this property at any object on your panel.
This also works with groups of objects - all children of the group will change color.
Shape
This property is of type Fixed list of ints and can be referenced with the variable name Shape.
Choose a simple shape for the LED when there is no 'Target' selected.
Width
This property is of type Floating point and can be referenced with the variable name Width.
Width of the LED shape.
Height
This property is of type Floating point and can be referenced with the variable name Height.
Height of the LED shape.
Depth
This property is of type Floating point and can be referenced with the variable name Depth.
Depth of the LED shape.