Skip to content

Instantly share code, notes, and snippets.

@natcl
Created March 6, 2019 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natcl/810709b5bb068b60e0697bbfd941007b to your computer and use it in GitHub Desktop.
Save natcl/810709b5bb068b60e0697bbfd941007b to your computer and use it in GitHub Desktop.
function pronto(d) {
var a=d.trim().split(" ").map(x=>parseInt(x,16));
var freq = 4145146/a[1];
Puck.IR(a.slice(4).map(x=>1000*x/freq));
}
var power = "0000 006C 0000 0022 00AD 00AD 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 06FB";
setWatch(
function() {
console.log("HH");
pronto(power);
},
BTN, // pin to watch
{edge:"rising", debounce:25, repeat:true} // settings
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment