LEDCollection

LEDCollection

new LEDCollection(_pinsopt, _kwpinsopt, _optionsopt)

Source:
Abstract base class for @link{LEDBoard} and @link{LEDBarGraph}.
Parameters:
Name Type Attributes Description
_pins Array <optional>
Array of pins that LEDs are connect to.
_kwpins Array <optional>
Array of tuples listing names for each pin eg [['red',17], ['amber',22]].
_options Object <optional>
Set options for the Collection: * pwm: Default: false, If true, creates PWMLED instances for each pin, else LED. * active_high: Default: true, If true, the on method will set all the associated pins to HIGH. If false, the on method will set all pins to LOW (the `off` method always does the opposite). * initial_value: If false, all LEDs will be off initially, if true the device will be Switched on initialled.

Extends

Methods

active_high() → {boolean}

Source:
Returns:
Indicates whether the device is active high (true) or low (false).
Type
boolean

close()

Source:
Inherited From:
Close all subordinate devices.

is_active() → {boolean}

Source:
Inherited From:
Returns:
- An array of each subordinate devices active state.
Type
boolean

leds() → {Array}

Source:
Returns:
- A flat array of tuples of all LEDs contained in this collection (and all sub-collections).
Type
Array

length() → {number}

Source:
Inherited From:
Returns:
- The number of subordinate devices.
Type
number

namedtuple() → {Array}

Source:
Inherited From:
Returns:
- An array of subordinate device names.
Type
Array

off()

Source:
Inherited From:
Calls the off method on all child devices within this composite device.

on()

Source:
Inherited From:
Calls the on method on all child devices within this composite device.

toggle()

Source:
Inherited From:
Calls the toggle method on all child devices within this composite device.

value(valueopt) → {Array}

Source:
Inherited From:
When value is undefined then the function returns the value of all child devices as an array. When value is set, all child devices will have their value set according to the value array.
Parameters:
Name Type Attributes Description
value Array <optional>
The value to set all of the child devices to.
Returns:
- The current value of each output device returned as an array.
Type
Array