From e3393e6e7d24f0837d23562ca300e38218ba6a21 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Sun, 17 Sep 2017 15:20:38 -0400 Subject: [PATCH] Add documentation to onoffsim --- lib/onoffsim/Readme.md | 21 +++++++++++++++++++++ lib/onoffsim/index.js | 10 ++++++++++ 2 files changed, 31 insertions(+) diff --git a/lib/onoffsim/Readme.md b/lib/onoffsim/Readme.md index e69de29..1825111 100644 --- a/lib/onoffsim/Readme.md +++ b/lib/onoffsim/Readme.md @@ -0,0 +1,21 @@ + + +## onoffsim +Object representing a fake onoff Gpio class + +**Kind**: global constant + + +### onoffsim.Gpio(no, dir, additional) ⇒ object +Gpio() - +Create's a Gpio class in the case of running on a dev machine + +**Kind**: static method of [onoffsim](#onoffsim) +**Returns**: object - Fake Gpio object + +| Param | Type | Description | +| --- | --- | --- | +| no | integer | Number of the GPIO pin | +| dir | string | Dirction of the pin, 'input' or 'output' | +| additional | string | Additional instructions for the GPIO pin, for 'input' type | + diff --git a/lib/onoffsim/index.js b/lib/onoffsim/index.js index b45bb01..cd3ca77 100644 --- a/lib/onoffsim/index.js +++ b/lib/onoffsim/index.js @@ -1,6 +1,16 @@ 'use strict' +/** Object representing a fake onoff Gpio class */ const onoffsim = { + /** + * Gpio() - + * Returns a Gpio class in the case of running on a dev machine + * + * @param {integer} no Number of the GPIO pin + * @param {string} dir Dirction of the pin, 'input' or 'output' + * @param {string} additional Additional instructions for the GPIO pin, for 'input' type + * @returns {object} Fake Gpio object + */ Gpio : function (no, dir = 'in', additional = 'none') { // return {