-
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:
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);
Hi Gordon. I already created a pull request for that code.