You are reading a single comment by @navas and its replies. Click here to read the full conversation.
  • hi everyone,

    Does any know how to capture multiple IR codes through an IR receiver at the same time? My remote seems to send multiple codes on a single press. How do you capture them on times?

    This example is good to capture events one code at a time. I can print them to console using

    but the problem is it is always printing the last one received.

    digitalWrite(B7, 0); // Set B7 to GND
    digitalWrite(A8, 1); // Set A8 to 3.3V
    // Because we're not using the module, we have to manually pull up the data pin
    // Keep somewhere to put the signal times
    var times = [];
    // now watch the input
    setWatch(function(e) {
      // work out how long the pulse was, in milliseconds
      var pulseLen = 1000 * (e.time - e.lastTime);
      // then save it, if it was less than 1 second
      if (pulseLen < 1000)
        times = [];
    }, B6, {repeat:true});



Avatar for navas @navas started