Constructor
new BuildLight(opts:)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
opts: |
Object
|
optional - scheme: color scheme array, defaults to [ 'red', 'green', 'blue' ] scheme allows flexibility to use BuildLight with various Delcom devices (RGB, RGY) - usbled: path to usbled installation, if not specified then it will try to find a usbled installation at /sys/bus/usb/drivers/usbled/ - interval: continuous task (e.g. blink) interval in milliseconds switching between displaying color and no color, default to 500ms - gen: generation number of the build light find the part number at the bottom of your device and check it at Delcom product page https://www.delcomproducts.com/products_USBLMP.asp |
Methods
_colours()
Initialise colour method based on colour scheme.
If scheme is [ 'red', 'green', 'blue' ], then you use:
buildLight.red();
buildLight.green();
buildLight.blue();
Each colour method will switch off all colours, then switch on one particular colour.
- Source:
_driver()
Select a driver to use based on platform.
BuildLight currently supports Linux platform only, contributions for other platforms are welcome.
- Linux platform uses usbled driver.
- Source:
blink(colour:, cb:)
Blink the specified colour.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
colour: |
String
|
a colour from the scheme, default scheme either red, green, or blue if no colour is specified then default to display all colours from the scheme |
cb: |
function
|
callback with error arg if there's any interruption |
unblink(cb:)
Stop blinking.
Wait for interval before calling callback to allow
in-progress blink to finish.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
cb: |
function
|
callback with error arg if there's any interruption |