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');