Skip to content
rc-switch port for espruino
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
LICENSE
README.md
RcSwitch.js

README.md

espruino_rc_switch

Espruino_rc_switch is a js library for the espurione platform to control 315/433MHz remote controlled power sockets. This library is ported from the Arduino rc-switch C++ library. (https://github.com/scottkellie/rc-switch)

Todo:

  • Write support
  • Read support

Usage example:

Brennstuhl rc settings

// 1 = Protocol
// D13 = Pin
// 10 = repeat
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");
  }
 }

 var i = setInterval(toggle, 5000);
You can’t perform that action at this time.