diff --git a/nodejs/ar-com/rc.js b/nodejs/ar-com/rc.js index 40763b1..af2e486 100644 --- a/nodejs/ar-com/rc.js +++ b/nodejs/ar-com/rc.js @@ -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')); -}; \ No newline at end of file +} + +module.exports = RC; \ No newline at end of file