diff --git a/arduino/src/sketch.ino b/arduino/src/sketch.ino index 4062273..d6d129b 100644 --- a/arduino/src/sketch.ino +++ b/arduino/src/sketch.ino @@ -168,7 +168,10 @@ void sendRCTristate (uint8_t val[], int pin) { } void irSend(int type, int length, unsigned long val) { - + char m[22]; + sprintf(m, "%04d::%04d::%09lu", type,length,val); + Serial.println(m); + for(int i = 0; i < 3; i++) { switch (type) { case RC5: irsend.sendRC5(val, length); break; diff --git a/nodejs/routes/index.js b/nodejs/routes/index.js index 5aa6408..06a4400 100644 --- a/nodejs/routes/index.js +++ b/nodejs/routes/index.js @@ -19,7 +19,7 @@ router.get('/toggleLight', function (req, res) { }); router.get('/irTest', function (req, res) { - arduino.write(new Buffer('Y0000000' ,'ascii')); + arduino.write(new Buffer('X' + String.fromCharCode(4) + String.fromCharCode(12) + String.fromCharCode(0)+String.fromCharCode(0)+String.fromCharCode(2689 / 256) + String.fromCharCode(2689 % 256),'ascii')); res.send('switch light'); });