You are reading a single comment by @JumJum and its replies. Click here to read the full conversation.
  • Still working on my rotary phone.
    For recognizing a simple test should help, thats the idea.

    function initWP(){
      var arr = new Uint8Array(100),pnt = 0,pulsePort = D3;
      pulsePort.mode('input_pullup');
      function pulseHnd(e){arr[pnt++] = e.state;}
      function logPulse(){
        console.log(new Uint8Array(arr.buffer,0,pnt));
        clearWatch();
      }
      setWatch(pulseHnd,pulsePort,{repeat:true­,edge:1,debounce:5});
      setWatch(pulseHnd,pulsePort,{repeat:true­,edge:-1,debounce:5});
      setTimeout(logPulse,5000);
    }
    

    Next switched to terminal window and checked several times.

    initWP()
    =undefined
    new Uint8Array([1, 1, 0])
    >initWP()
    =undefined
    new Uint8Array([1, 1, 1, 1, 1, 0])
    >initWP()
    =undefined
    new Uint8Array([1, 1, 1, 1, 0])
    >initWP()
    =undefined
    new Uint8Array([1, 1, 1, 0])
    >initWP()
    =undefined
    new Uint8Array([0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0])
    > 
    

    How can I get raising edge several times, without having falling edge between ?
    Checked the same with one watch (edge:0) and got similiar result.

About

Avatar for JumJum @JumJum started