Skip to content

Commit

Permalink
DigitalSensor.read -> return the value instead of the Buffer object
Browse files Browse the repository at this point in the history
  • Loading branch information
memetolsen committed Dec 17, 2015
1 parent 82ba112 commit f3e8327
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Software/NodeJS/libs/sensors/base/digitalSensor.js
Expand Up @@ -13,7 +13,7 @@ DigitalSensor.prototype.read = function() {
var writeRet = this.board.writeBytes(commands.dRead.concat([this.pin, commands.unused, commands.unused]))
if (writeRet) {
this.board.wait(100)
return this.board.readByte()
return this.board.readByte()[0]
} else {
return false
}
Expand All @@ -22,4 +22,4 @@ DigitalSensor.prototype.write = function(value) {
return this.board.writeBytes(commands.dWrite.concat([this.pin, value, commands.unused]))
}

module.exports = DigitalSensor
module.exports = DigitalSensor

0 comments on commit f3e8327

Please sign in to comment.