mino bug fixes

This commit is contained in:
Shannon Sterz 2016-02-17 14:14:18 +01:00
parent 43ea1e9eb1
commit f8436e2a81

View file

@ -1,4 +1,5 @@
var events = require('events'),
util = require('util');
var RC = function (arduino, pin) {
if(!arduino){throw new Error('Arduino must be set');}
@ -10,7 +11,7 @@ RC.prototype.send = function(tristate) {
var str = '';
for(i = 0; i < s.length; i+=2) { str += String.fromCharCode(parseInt(tristate.substr(i,2), 16)); }
arduino.write(new Buffer('W' + String.fromCharCode(97 + this.pin) + str,'ascii'));
};
}
RC.prototype.sendDecimal = function (len, val) {
@ -18,4 +19,6 @@ RC.prototype.sendDecimal = function (len, val) {
val = this.arduino.valueToLastFour(val);
arduino.write(new Buffer('W' + String.fromCharCode(97 + this.pin) + len + val,'ascii'));
};
}
module.exports = RC;