Component: LED Bar v2.0 (104020006) (Grove)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 1.0 (Release)
Category Grove


Image LED Bar v2.0 (104020006) component

LED Bar is comprised of a 10 segment LED gauge bar and an MY9221 LED controlling chip. It can be used as a indicator for remaining battery life, voltage, water level, music volume or other values that require a gradient display. There are 10 LED bars in the LED bar graph: one red, one yellow, one light green, and the rest green. It lights up the LEDs sequentially from red to green, so the entire bar graph is lit up in the end.

Examples

No additional examples


Downloadable macro reference

SetBinary

Allows a binary value to be shown on the LEDs.

Red = Bit0

Yellow = Bit1

Light Green = Bit2

Green = Bit3 - Bit9

Parameters

UINT Data


Return value

This call does not return a value


SetLevelReverse

Set level 0-10 in reverse, green to red, where 10 is red

Level 0 means all leds off while level 5 means leds 1-5 on and 6-10 will be off

Parameters

BYTE Level
Range: 0-10


Return value

This call does not return a value


SetLevel

Set level 0-10, red to green, where 1 is red

Level 0 means all leds off while level 5 means leds 1-5 on and 6-10 will be off

Parameters

BYTE Level
Range: 0-10


Return value

This call does not return a value


SetSingleLED

Allows a single LED to be controlled and switched on or off.

LED 0 = Red

LED 1 = Yellow

LED 2 = Light Green

LED 3-9 = Green

Parameters

BYTE LED
Range: 0-9
BYTE State
0=Off / 1=On


Return value

This call does not return a value


Simulation macro reference

LatchDataSim

Latches the data and shifts the new input to the output.

Parameters

This macro has no parameters


Return value

This call does not return a value



Property reference

Data

This property is of type Single digital pin and can be referenced with the variable name Data.

Data pin

Clock

This property is of type Single digital pin and can be referenced with the variable name Clock.

Clock pin