From 2a508aac5012930cdd167226d71ce9186c6a6ede Mon Sep 17 00:00:00 2001 From: vaishnav98 Date: Sun, 27 May 2018 06:15:03 +0530 Subject: [PATCH] fix faulty condition digitalWrite on AnalogOut --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 66f41dc6..65eb54a7 100644 --- a/src/index.js +++ b/src/index.js @@ -237,7 +237,7 @@ f.digitalWrite = function (pin, value, callback) { if (debug) winston.debug('digitalWrite(' + [pin.key, value] + ');'); value = parseInt(Number(value), 2) ? 1 : 0; //handle case digitalWrite() on Analog_Out - if (pin.pwm != 'undefined') { + if (typeof pin.pwm != 'undefined') { var gpioEnabled = (7 == f.getPinMode(pin).mux); //check whether pin set as gpio if (!gpioEnabled) { winston.debug([pin.key, value] + ' set as ANALOG_OUTPUT modifying duty cycle according to value');