From f840adb5f0e22f4ae2a2f119205ae54e590d5536 Mon Sep 17 00:00:00 2001 From: Nathan Kunicki Date: Wed, 20 Jun 2018 11:37:01 +0100 Subject: [PATCH] Temporary readme --- README.md | 147 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 131 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index f887881..ce4152c 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,6 @@ Emits when a LPF2 Hub device is found. * [.connect([callback])](#Hub+connect) * [.subscribe(port, [mode])](#Hub+subscribe) * [.unsubscribe(port)](#Hub+unsubscribe) - * [.connectCallback](#Hub+connectCallback) : function @@ -59,7 +58,7 @@ Connect to the Hub. | Param | Type | | --- | --- | -| [callback] | [connectCallback](#Hub+connectCallback) | +| [callback] | function | @@ -84,10 +83,6 @@ Unsubscribe to sensor notifications on a given port. | --- | --- | | port | string | - - -### hub.connectCallback : function -**Kind**: instance typedef of [Hub](#Hub) ## WeDo2Hub ⇐ [Hub](#Hub) @@ -101,7 +96,11 @@ Unsubscribe to sensor notifications on a given port. * [.connect([callback])](#Hub+connect) * [.subscribe(port, [mode])](#Hub+subscribe) * [.unsubscribe(port)](#Hub+unsubscribe) - * [.connectCallback](#Hub+connectCallback) : function + * ["button" (state)](#WeDo2Hub+event_button) + * ["distance" (port, distance)](#WeDo2Hub+event_distance) + * ["color" (port, color)](#WeDo2Hub+event_color) + * ["tilt" (port, x, y)](#WeDo2Hub+event_tilt) + * ["rotate" (port, rotation)](#WeDo2Hub+event_rotate) @@ -149,7 +148,7 @@ Connect to the Hub. | Param | Type | | --- | --- | -| [callback] | [connectCallback](#Hub+connectCallback) | +| [callback] | function | @@ -174,10 +173,66 @@ Unsubscribe to sensor notifications on a given port. | --- | --- | | port | string | - + + +### "button" (state) +Emits when a button is pressed. + +**Kind**: event emitted by [WeDo2Hub](#WeDo2Hub) + +| Param | Type | Description | +| --- | --- | --- | +| state | number | A number representing one of the button state consts. | + + + +### "distance" (port, distance) +Emits when a distance sensor is activated. + +**Kind**: event emitted by [WeDo2Hub](#WeDo2Hub) + +| Param | Type | Description | +| --- | --- | --- | +| port | string | | +| distance | number | Distance, in millimeters. | + + + +### "color" (port, color) +Emits when a color sensor is activated. + +**Kind**: event emitted by [WeDo2Hub](#WeDo2Hub) + +| Param | Type | Description | +| --- | --- | --- | +| port | string | | +| color | number | A number representing one of the LED color consts. | + + + +### "tilt" (port, x, y) +Emits when a tilt sensor is activated. + +**Kind**: event emitted by [WeDo2Hub](#WeDo2Hub) + +| Param | Type | +| --- | --- | +| port | string | +| x | number | +| y | number | + + + +### "rotate" (port, rotation) +Emits when a rotation sensor is activated. + +**Kind**: event emitted by [WeDo2Hub](#WeDo2Hub) + +| Param | Type | +| --- | --- | +| port | string | +| rotation | number | -### weDo2Hub.connectCallback : function -**Kind**: instance typedef of [WeDo2Hub](#WeDo2Hub) ## BoostHub ⇐ [Hub](#Hub) @@ -191,7 +246,11 @@ Unsubscribe to sensor notifications on a given port. * [.connect([callback])](#Hub+connect) * [.subscribe(port, [mode])](#Hub+subscribe) * [.unsubscribe(port)](#Hub+unsubscribe) - * [.connectCallback](#Hub+connectCallback) : function + * ["button" (state)](#BoostHub+event_button) + * ["distance" (port, distance)](#BoostHub+event_distance) + * ["color" (port, color)](#BoostHub+event_color) + * ["tilt" (port, x, y)](#BoostHub+event_tilt) + * ["rotate" (port, rotation)](#BoostHub+event_rotate) @@ -240,7 +299,7 @@ Connect to the Hub. | Param | Type | | --- | --- | -| [callback] | [connectCallback](#Hub+connectCallback) | +| [callback] | function | @@ -265,7 +324,63 @@ Unsubscribe to sensor notifications on a given port. | --- | --- | | port | string | - + + +### "button" (state) +Emits when a button is pressed. + +**Kind**: event emitted by [BoostHub](#BoostHub) + +| Param | Type | Description | +| --- | --- | --- | +| state | number | A number representing one of the button state consts. | + + + +### "distance" (port, distance) +Emits when a distance sensor is activated. + +**Kind**: event emitted by [BoostHub](#BoostHub) + +| Param | Type | Description | +| --- | --- | --- | +| port | string | | +| distance | number | Distance, in millimeters. | + + + +### "color" (port, color) +Emits when a color sensor is activated. + +**Kind**: event emitted by [BoostHub](#BoostHub) + +| Param | Type | Description | +| --- | --- | --- | +| port | string | | +| color | number | A number representing one of the LED color consts. | + + + +### "tilt" (port, x, y) +Emits when a tilt sensor is activated. + +**Kind**: event emitted by [BoostHub](#BoostHub) + +| Param | Type | +| --- | --- | +| port | string | +| x | number | +| y | number | + + + +### "rotate" (port, rotation) +Emits when a rotation sensor is activated. + +**Kind**: event emitted by [BoostHub](#BoostHub) + +| Param | Type | +| --- | --- | +| port | string | +| rotation | number | -### boostHub.connectCallback : function -**Kind**: instance typedef of [BoostHub](#BoostHub)