Component: LED Multicolour RGB (5mm, PCB) ()

From Flowcode Help
Revision as of 21:08, 16 November 2021 by Wiki bot (talk | contribs)
Jump to navigationJump to search
Author Matrix
Version 1.2
Category


LED Multicolour RGB (5mm, PCB) component

A simulatable RGB LED in a standard 5mm through-hole PCB mount package. Three port pins each output a simple PWM signal - one for each of the primary colours. The colors can then be mixed in any proportions to allow the desired color to be produced.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Downloadable macro reference

Fc9-comp-macro.png Enable
Enables the RGB LED. This must be done before the LED can be lit or the color changed. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png 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. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png 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). 
Fc9-u8-icon.png - BYTE red
Red component of RGB LED local to this macro 
Fc9-u8-icon.png - BYTE green
Green component of RGB LED local to this macro 
Fc9-u8-icon.png - BYTE blue
Blue component of RGB LED local to this macro 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WriteMicroseconds
Sets the PWM output of one of the PCA9685 pins based on the input microseconds, output is not precise 
Fc9-u8-icon.png - BYTE Output
One of the PWM output pins - Range: 0 to 15 
Fc9-u16-icon.png - UINT Microseconds
The number of Microseconds to turn the PWM output ON 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetPWM
Sets the PWM output of one of the PCA9685 pins 
Fc9-u8-icon.png - BYTE Output
One of the PWM output pins - Range: 0 to 15 
Fc9-u16-icon.png - UINT On
At what point in the 4096-part cycle to turn the PWM output ON 
Fc9-u16-icon.png - UINT Off
At what point in the 4096-part cycle to turn the PWM output OFF 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Sets up the I2C ready for communications to begin 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WakeUp
Wakes the module from Sleep mode 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetPin
Sets pin without having to deal with on/off tick placement and properly handles a zero value as completely off and 4095 as completely on. 
Fc9-u8-icon.png - BYTE Output
One of the PWM output pins - Range: 0 to 15 
Fc9-u16-icon.png - UINT Duty
The number of ticks out of 4096 to be active 
[[File:]] - Invert
0=Normal, 1=Inverted 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png DrawRectangle2D
Draws a basic 2D rectangle onto the LEDs 
Fc9-u8-icon.png - BYTE X1
 
Fc9-u8-icon.png - BYTE Y1
 
Fc9-u8-icon.png - BYTE X2
 
Fc9-u8-icon.png - BYTE Y2
 
Fc9-u8-icon.png - BYTE DrawStyle
Sets the draw style - 0=Soild, 1=Edge, 2=Corners 
Fc9-u8-icon.png - BYTE R
 
Fc9-u8-icon.png - BYTE G
 
Fc9-u8-icon.png - BYTE B
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ShiftLEDs2D
Shifts the contents of the display by the number of vertices specified ***Please Note that Wrap mode is currently unavailable*** 
[[File:]] - X
Number of pixels to shift the display -1 to 1 / 0 = No Shift 
[[File:]] - Y
Number of pixels to shift the display -1 to 1 / 0 = No Shift 
Fc9-u8-icon.png - BYTE DataMode
0=ResetToZero, 1=WrapAroundDisplay, 2=Smear 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetLEDIndex3D
Gets the index of a single LED in RAM as a 3D array. 
Fc9-u16-icon.png - UINT X
LED Column to change the colour / Range: 0 to (LED Column - 1) 
Fc9-u16-icon.png - UINT Y
LED Row to change the colour / Range: 0 to (LED Row - 1) 
Fc9-u16-icon.png - UINT Z
LED Layer to change the colour / Range: 0 to (LED Layer - 1) 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png DrawCuboid3D
Draws a basic 3D cuboid onto the LEDs 
Fc9-u8-icon.png - BYTE X1
Start X pixel coordinate 
Fc9-u8-icon.png - BYTE Y1
Start Y pixel coordinate 
Fc9-u8-icon.png - BYTE Z1
Start Z pixel coordinate 
Fc9-u8-icon.png - BYTE X2
End X pixel coordinate 
Fc9-u8-icon.png - BYTE Y2
End Y pixel coordinate 
Fc9-u8-icon.png - BYTE Z2
End Z pixel coordinate 
Fc9-u8-icon.png - BYTE DrawStyle
Sets the draw style - 0=Soild, 1=Edge, 2=Corners 
Fc9-u8-icon.png - BYTE R
Red Colour Channel 
Fc9-u8-icon.png - BYTE G
Green Colour Channel 
Fc9-u8-icon.png - BYTE B
White Colour Channel 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Inisialises the RGB colour RAM to 0,0,0 = LED Off and clocks out the data to initialise all the LED ICs in the chain. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ShiftLEDs3D
Shifts the contents of the display by the number of vertices specified ***Please Note that Wrap mode is currently unavailable*** 
[[File:]] - X
Number of pixels to shift the display -1 to 1 / 0 = No Shift 
[[File:]] - Y
Number of pixels to shift the display -1 to 1 / 0 = No Shift 
[[File:]] - Z
Number of pixels to shift the display -1 to 1 / 0 = No Shift 
Fc9-u8-icon.png - BYTE DataMode
0=ResetToZero, 1=WrapAroundDisplay, 2=Smear 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Sets up the data memory and draws the simulated LED cube on the panel. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-5-icon.png Red
Pin that the red LED is connected to. 
Fc9-type-5-icon.png Green
Pin that the green LED is connected to. 
Fc9-type-5-icon.png Blue
Pin tha the Blue pin is connected to. 
Fc9-type-16-icon.png Polarity
Active High: Use for common cathode LEDs - Pin true = LED On. Active Low: Use for common anode LEDs - Pin false = LED On. 
Fc9-type-16-icon.png Color bit size
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. 
Fc9-type-14-icon.png Rollover value
The number of unique colours each R/G/B channel can output. Range: 0 to (Rollover Value - 1). 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations