Update digital read to parseInt buffer response.

This commit is contained in:
Edgar O Silva 2013-11-27 18:03:02 -06:00
parent 3ceda8f76e
commit 402edc1a1e
2 changed files with 4 additions and 4 deletions

4
dist/digital-pin.js vendored
View File

@ -99,8 +99,8 @@
if (err) {
return _this.emit('error', "Error occurred while reading from pin " + _this.pinNum);
} else {
readData = data.toString();
return _this.emit('digitalRead', data);
readData = parseInt(data.toString());
return _this.emit('digitalRead', readData);
}
});
}, interval);

View File

@ -72,8 +72,8 @@ namespace 'Cylon.IO', ->
if err
@emit('error', "Error occurred while reading from pin #{ @pinNum }")
else
readData = data.toString()
@emit('digitalRead', data)
readData = parseInt(data.toString())
@emit('digitalRead', readData)
)
, interval)