IR Receiver/Sender


What's this

Receive a IR signal from remote controller and show signals array on Web.
Then "send" button will appear. By pressing it, you can generate recorded signal.

Connect IR Receiver and InfraredLED to an obniz.


<!-- HTML Example -->
<!DOCTYPE html>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href=""  integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <script src="" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  <script src=""></script>

<div id="obniz-debug"></div>
<div class="container text-center">
  <h1> IR Playground </h1>
    This monitor IR signal. If detected, data and Transmit button appear.
      <div> io0: vcc of IRSensor</div>
      <div> io1: gnd of IRSensor</div>
      <div> io2: output of IRSensor</div>
      <div> <br></div>
      <div> io10: InfraredLED anode</div>
      <div> io11: InfraredLED cathode</div>
  <div id="recorded">


/* This will be over written on webapp page */
var obniz = new Obniz("OBNIZ_ID_HERE");

obniz.onconnect = async function () {
  var led = obniz.wired('InfraredLED', {anode: 10, cathode: 11});
  var sensor = obniz.wired('IRSensor', {vcc:0, gnd:1, output: 2});
  var index = 0;
  sensor.duration = 400;
    const data = JSON.stringify(arr);
    let str = "<div class ='row'><div class='col-sm-9'><textarea class='form-control' style='font-size:11px;height:80px;' id='recvd"+index+"'>";
    str += data; 
    str += "

Run Now

The html will be opened to run a program.