"use strict";
var Cylon = require("cylon");
Cylon.robot({
connections: {
tessel: { adaptor: "tessel", port: "A" }
},
devices: {
ir: { driver: "ir-attx4" }
},
work: function(my) {
my.ir.on("error", function(err) {
console.log(err);
});
my.ir.on("data", function(data) {
console.log("Received RX Data: ", data);
});
every((3).seconds(), function() {
var powerBuffer = new Buffer([0, 178, 255, 168, 0, 12, 255, 246, 0, 13, 255, 225, 0, 13, 255, 224, 0, 12, 255, 246, 0, 12, 255, 246, 0, 13, 255, 247, 0, 13, 255, 247, 0, 13, 255, 224, 0, 12, 255, 224, 0, 13, 255, 247, 0, 13, 255, 224, 0, 12, 255, 246, 0, 12, 255, 246, 0, 12, 255, 246, 0, 12, 255, 246, 0, 13, 255, 247, 0, 13, 255, 224, 0, 12, 255, 224, 0, 13, 255, 225, 0, 13, 255, 224, 0, 12, 255, 246, 0, 12, 255, 246, 0, 13, 255, 247, 0, 13, 255, 247, 0, 13, 255, 246, 0, 12, 255, 246, 0, 12, 255, 246, 0, 12, 255, 246, 0, 12, 255, 224, 0, 13, 255, 224, 0, 12, 255, 224, 0, 12, 255, 224, 0, 12]);
my.ir.sendRawSignal(38, powerBuffer, function(err) {
if (err) {
console.log("Unable to send signal: ", err);
} else {
console.log("Signal sent!");
}
});
});
}
}).start();