I have started to translate the rc-switch library from c ++ to js. The write path already works fine.
Its the same intention like this article (https://www.espruino.com/Remote+Control+Sockets). But you do not need to read the code of every remote control socket. Just pass the socket switch settings.
var sw = new RcSwitch(1, D13, 10);
var on = false;
function toggle() {
on = !on;
if (on) {
sw.switchOn("11110", "10000");
console.log("switchOn");
}
else{
sw.switchOff("11110", "10000");
console.log("switchOff");
}
}
setInterval(toggle, 5000);
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I have started to translate the rc-switch library from c ++ to js. The write path already works fine.
Its the same intention like this article (https://www.espruino.com/Remote+Control+Sockets). But you do not need to read the code of every remote control socket. Just pass the socket switch settings.
https://github.com/xargon180/espruino_rc_switch
usage example: