From b92855d132266588781258305d43bbcb1fee2d1c Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Tue, 12 Jul 2016 13:47:04 -0400 Subject: [PATCH] Accelerometer: remove unnecessary array path for analogInitialize; Update ESPLORA controller to assign pins correctly. Signed-off-by: Rick Waldron --- lib/accelerometer.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/accelerometer.js b/lib/accelerometer.js index 7c0d7ce4c..17e870e65 100644 --- a/lib/accelerometer.js +++ b/lib/accelerometer.js @@ -17,14 +17,13 @@ var calibrationSize = 10; var axes = ["x", "y", "z"]; function analogInitialize(opts, dataHandler) { - var pins = opts.pins || [], - state = priv.get(this), - dataPoints = {}; + var state = priv.get(this); + var dataPoints = {}; state.zeroV = opts.zeroV || this.DEFAULTS.zeroV; state.sensitivity = opts.sensitivity || this.DEFAULTS.sensitivity; - pins.forEach(function(pin, index) { + this.pins.forEach(function(pin, index) { this.io.pinMode(pin, this.io.MODES.ANALOG); this.io.analogRead(pin, function(data) { var axis = axes[index]; @@ -619,7 +618,7 @@ var Controllers = { }, initialize: { value: function(opts, dataHandler) { - opts.pins = [5, 11, 6]; + this.pins = [5, 11, 6]; analogInitialize.call(this, opts, dataHandler); } },