Update digital read to parseInt buffer response.
This commit is contained in:
parent
3ceda8f76e
commit
402edc1a1e
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue