Change your code to detect both rising and falling transitions, and their timestamp. Do any processing needed, then wait until micros() - currentTime > 15. Should be fine as long as your signal duty cycle is about 50% and processing takes under 16ms
You could add something like that to your if-statement to detect a new pulse only after your defined time window:
if (.... && (micros()-lastTime > 15))
Thanks to all, good suggestions that I'll keep up my sleeve.
After a bit of playing round, came up with a pulse shaping circuit that it looks like will work. A 150n capacitor from the sense input to Vcc, and a 6K8 resistor from the input to 0v...
Hi, I have input from an anemometer head to a Teensy 4.0, it's a squarewave ranging in frequency from a few Hz up to about 30 Hz. Checking the switching on a scope, there is debounce apparent, but it's all inside a 15 microsecond window. Using...