You are reading a single comment by @MattC and its replies. Click here to read the full conversation.
  • I can confirm the new firmware fixes the issue :)

    The puck can now replay the IR pulses perfectly

    Code below if anyone is interested

    
    pinMode(D1,"input_pullup");
    var times = [];
    
    var currentWatch;
    function startWatching() {
      currentWatch = 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.push(pulseLen);
        } else {
          times = [];
        }
      }, D1, {repeat:true});
    }
    
    startWatching();
    
    function stopWatching() {
      clearWatch(currentWatch);
      currentWatch = null;
    }
    
    setWatch(function(e) {
        
       stopWatching();
       Puck.IR(times);
       console.log(times);   
       startWatching();    
    }, BTN, { repeat: true, edge: 'rising', debounce: 50 });
    

    Thanks for your help.

About

Avatar for MattC @MattC started