From 439a115e747bb051e262784095a7099f9c91a5df Mon Sep 17 00:00:00 2001 From: Nathan Kellenicki Date: Sun, 14 Oct 2018 10:40:26 -0700 Subject: [PATCH] Added RGB color mode to LED lights on Boost Move Hub and PUP Hub and Remote --- DOCS.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) diff --git a/DOCS.md b/DOCS.md index f60fa32..2b5c01f 100644 --- a/DOCS.md +++ b/DOCS.md @@ -415,6 +415,7 @@ Emits when an attached motor or sensor is detached from the Hub. * [.setLightBrightness(port, brightness, [time])](#BoostMoveHub+setLightBrightness) ⇒ Promise * [.setName(name)](#LPF2Hub+setName) ⇒ Promise * [.setLEDColor(color)](#LPF2Hub+setLEDColor) ⇒ Promise + * [.setLEDRGB(red, green, blue)](#LPF2Hub+setLEDRGB) ⇒ Promise * [.connect()](#Hub+connect) ⇒ Promise * [.disconnect()](#Hub+disconnect) ⇒ Promise * [.subscribe(port, [mode])](#Hub+subscribe) ⇒ Promise @@ -570,6 +571,20 @@ Set the color of the LED on the Hub via a color value. | --- | --- | --- | | color | number | A number representing one of the LED color consts. | + + +### boostMoveHub.setLEDRGB(red, green, blue) ⇒ Promise +Set the color of the LED on the Hub via RGB values. + +**Kind**: instance method of [BoostMoveHub](#BoostMoveHub) +**Returns**: Promise - Resolved upon successful issuance of command. + +| Param | Type | +| --- | --- | +| red | number | +| green | number | +| blue | number | + ### boostMoveHub.connect() ⇒ Promise @@ -740,6 +755,7 @@ Emits when an attached motor or sensor is detached from the Hub. * [.setLightBrightness(port, brightness, [time])](#PUPHub+setLightBrightness) ⇒ Promise * [.setName(name)](#LPF2Hub+setName) ⇒ Promise * [.setLEDColor(color)](#LPF2Hub+setLEDColor) ⇒ Promise + * [.setLEDRGB(red, green, blue)](#LPF2Hub+setLEDRGB) ⇒ Promise * [.connect()](#Hub+connect) ⇒ Promise * [.disconnect()](#Hub+disconnect) ⇒ Promise * [.subscribe(port, [mode])](#Hub+subscribe) ⇒ Promise @@ -880,6 +896,20 @@ Set the color of the LED on the Hub via a color value. | --- | --- | --- | | color | number | A number representing one of the LED color consts. | + + +### pupHub.setLEDRGB(red, green, blue) ⇒ Promise +Set the color of the LED on the Hub via RGB values. + +**Kind**: instance method of [PUPHub](#PUPHub) +**Returns**: Promise - Resolved upon successful issuance of command. + +| Param | Type | +| --- | --- | +| red | number | +| green | number | +| blue | number | + ### pupHub.connect() ⇒ Promise @@ -1034,6 +1064,7 @@ Emits when an attached motor or sensor is detached from the Hub. * [.rssi](#Hub+rssi) * [.batteryLevel](#Hub+batteryLevel) * [.setLEDColor(color)](#PUPRemote+setLEDColor) ⇒ Promise + * [.setLEDRGB(red, green, blue)](#PUPRemote+setLEDRGB) ⇒ Promise * [.setName(name)](#LPF2Hub+setName) ⇒ Promise * [.connect()](#Hub+connect) ⇒ Promise * [.disconnect()](#Hub+disconnect) ⇒ Promise @@ -1116,6 +1147,21 @@ Set the color of the LED on the Remote via a color value. | --- | --- | --- | | color | number | A number representing one of the LED color consts. | + + +### pupRemote.setLEDRGB(red, green, blue) ⇒ Promise +Set the color of the LED on the Hub via RGB values. + +**Kind**: instance method of [PUPRemote](#PUPRemote) +**Overrides**: [setLEDRGB](#LPF2Hub+setLEDRGB) +**Returns**: Promise - Resolved upon successful issuance of command. + +| Param | Type | +| --- | --- | +| red | number | +| green | number | +| blue | number | + ### pupRemote.setName(name) ⇒ Promise @@ -1226,6 +1272,7 @@ Emits when a button is pressed. * [.playSound(sound)](#DuploTrainBase+playSound) ⇒ Promise * [.rampMotorSpeed(port, fromSpeed, toSpeed, time)](#DuploTrainBase+rampMotorSpeed) ⇒ Promise * [.setName(name)](#LPF2Hub+setName) ⇒ Promise + * [.setLEDRGB(red, green, blue)](#LPF2Hub+setLEDRGB) ⇒ Promise * [.connect()](#Hub+connect) ⇒ Promise * [.disconnect()](#Hub+disconnect) ⇒ Promise * [.subscribe(port, [mode])](#Hub+subscribe) ⇒ Promise @@ -1365,6 +1412,20 @@ Set the name of the Hub. | --- | --- | --- | | name | string | New name of the hub (14 characters or less, ASCII only). | + + +### duploTrainBase.setLEDRGB(red, green, blue) ⇒ Promise +Set the color of the LED on the Hub via RGB values. + +**Kind**: instance method of [DuploTrainBase](#DuploTrainBase) +**Returns**: Promise - Resolved upon successful issuance of command. + +| Param | Type | +| --- | --- | +| red | number | +| green | number | +| blue | number | + ### duploTrainBase.connect() ⇒ Promise diff --git a/README.md b/README.md index ac984a2..4ddb31f 100644 --- a/README.md +++ b/README.md @@ -494,6 +494,7 @@ Emits when an attached motor or sensor is detached from the Hub. * [.setLightBrightness(port, brightness, [time])](#BoostMoveHub+setLightBrightness) ⇒ Promise * [.setName(name)](#LPF2Hub+setName) ⇒ Promise * [.setLEDColor(color)](#LPF2Hub+setLEDColor) ⇒ Promise + * [.setLEDRGB(red, green, blue)](#LPF2Hub+setLEDRGB) ⇒ Promise * [.connect()](#Hub+connect) ⇒ Promise * [.disconnect()](#Hub+disconnect) ⇒ Promise * [.subscribe(port, [mode])](#Hub+subscribe) ⇒ Promise @@ -649,6 +650,20 @@ Set the color of the LED on the Hub via a color value. | --- | --- | --- | | color | number | A number representing one of the LED color consts. | + + +### boostMoveHub.setLEDRGB(red, green, blue) ⇒ Promise +Set the color of the LED on the Hub via RGB values. + +**Kind**: instance method of [BoostMoveHub](#BoostMoveHub) +**Returns**: Promise - Resolved upon successful issuance of command. + +| Param | Type | +| --- | --- | +| red | number | +| green | number | +| blue | number | + ### boostMoveHub.connect() ⇒ Promise @@ -819,6 +834,7 @@ Emits when an attached motor or sensor is detached from the Hub. * [.setLightBrightness(port, brightness, [time])](#PUPHub+setLightBrightness) ⇒ Promise * [.setName(name)](#LPF2Hub+setName) ⇒ Promise * [.setLEDColor(color)](#LPF2Hub+setLEDColor) ⇒ Promise + * [.setLEDRGB(red, green, blue)](#LPF2Hub+setLEDRGB) ⇒ Promise * [.connect()](#Hub+connect) ⇒ Promise * [.disconnect()](#Hub+disconnect) ⇒ Promise * [.subscribe(port, [mode])](#Hub+subscribe) ⇒ Promise @@ -959,6 +975,20 @@ Set the color of the LED on the Hub via a color value. | --- | --- | --- | | color | number | A number representing one of the LED color consts. | + + +### pupHub.setLEDRGB(red, green, blue) ⇒ Promise +Set the color of the LED on the Hub via RGB values. + +**Kind**: instance method of [PUPHub](#PUPHub) +**Returns**: Promise - Resolved upon successful issuance of command. + +| Param | Type | +| --- | --- | +| red | number | +| green | number | +| blue | number | + ### pupHub.connect() ⇒ Promise @@ -1113,6 +1143,7 @@ Emits when an attached motor or sensor is detached from the Hub. * [.rssi](#Hub+rssi) * [.batteryLevel](#Hub+batteryLevel) * [.setLEDColor(color)](#PUPRemote+setLEDColor) ⇒ Promise + * [.setLEDRGB(red, green, blue)](#PUPRemote+setLEDRGB) ⇒ Promise * [.setName(name)](#LPF2Hub+setName) ⇒ Promise * [.connect()](#Hub+connect) ⇒ Promise * [.disconnect()](#Hub+disconnect) ⇒ Promise @@ -1195,6 +1226,21 @@ Set the color of the LED on the Remote via a color value. | --- | --- | --- | | color | number | A number representing one of the LED color consts. | + + +### pupRemote.setLEDRGB(red, green, blue) ⇒ Promise +Set the color of the LED on the Hub via RGB values. + +**Kind**: instance method of [PUPRemote](#PUPRemote) +**Overrides**: [setLEDRGB](#LPF2Hub+setLEDRGB) +**Returns**: Promise - Resolved upon successful issuance of command. + +| Param | Type | +| --- | --- | +| red | number | +| green | number | +| blue | number | + ### pupRemote.setName(name) ⇒ Promise @@ -1305,6 +1351,7 @@ Emits when a button is pressed. * [.playSound(sound)](#DuploTrainBase+playSound) ⇒ Promise * [.rampMotorSpeed(port, fromSpeed, toSpeed, time)](#DuploTrainBase+rampMotorSpeed) ⇒ Promise * [.setName(name)](#LPF2Hub+setName) ⇒ Promise + * [.setLEDRGB(red, green, blue)](#LPF2Hub+setLEDRGB) ⇒ Promise * [.connect()](#Hub+connect) ⇒ Promise * [.disconnect()](#Hub+disconnect) ⇒ Promise * [.subscribe(port, [mode])](#Hub+subscribe) ⇒ Promise @@ -1444,6 +1491,20 @@ Set the name of the Hub. | --- | --- | --- | | name | string | New name of the hub (14 characters or less, ASCII only). | + + +### duploTrainBase.setLEDRGB(red, green, blue) ⇒ Promise +Set the color of the LED on the Hub via RGB values. + +**Kind**: instance method of [DuploTrainBase](#DuploTrainBase) +**Returns**: Promise - Resolved upon successful issuance of command. + +| Param | Type | +| --- | --- | +| red | number | +| green | number | +| blue | number | + ### duploTrainBase.connect() ⇒ Promise