From d6d3326a82efc7489db8b1d94f3a9fe1efb091d3 Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Sun, 28 Feb 2016 21:20:08 +0100 Subject: [PATCH] update ir test route --- nodejs/routes/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nodejs/routes/index.js b/nodejs/routes/index.js index 0945531..4e8ad0c 100644 --- a/nodejs/routes/index.js +++ b/nodejs/routes/index.js @@ -14,6 +14,7 @@ var users = new models.Users(); // Arduino communications var arduino = new arcom.Arduino(config.debug); var rc = new arcom.RC(arduino); +var ir = new arcom.ir(arduino); // Get arduino ready arduino.setup(); @@ -59,7 +60,8 @@ router.post('/changeRC', auth, function (req, res, next){ // IR Routes router.get('/irTest', auth, function (req, res) { - arduino.write(new Buffer('X0' + String.fromCharCode(4) + String.fromCharCode(12) + String.fromCharCode(0)+String.fromCharCode(0)+String.fromCharCode(2689 / 256) + String.fromCharCode(2689 % 256),'ascii')); + //arduino.write(new Buffer('X0' + String.fromCharCode(4) + String.fromCharCode(12) + String.fromCharCode(0)+String.fromCharCode(0)+String.fromCharCode(2689 / 256) + String.fromCharCode(2689 % 256),'ascii')); + ir.send(4,12,2689); res.send('switch light'); });