update ir test route

This commit is contained in:
Shannon Sterz 2016-02-28 21:20:08 +01:00
parent 969f232bbe
commit d6d3326a82

View file

@ -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');
});