Porting the arduiono rc-switch library to js

Posted 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:

    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);
    
  • That's great - thanks! Thanks for the pull request - I'll get that code merged in!

  • Hi Gordon. I already created a pull request for that code.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Porting the arduiono rc-switch library to js

Posted by Avatar for xargon180 @xargon180

Actions