From f8436e2a8103bfd84f2a034f2451c28dd1984ec3 Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Wed, 17 Feb 2016 14:14:18 +0100 Subject: [PATCH] mino bug fixes --- nodejs/ar-com/rc.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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