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.
@JumJum started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Still working on my rotary phone.
For recognizing a simple test should help, thats the idea.
Next switched to terminal window and checked several times.
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.