Skip to content

Commit

Permalink
fix faulty condition digitalWrite on AnalogOut
Browse files Browse the repository at this point in the history
  • Loading branch information
vaishnavachath committed May 27, 2018
1 parent 2ac415e commit 2a508aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 2a508aa

Please sign in to comment.