i maded program that senses the duration beetwen 2 rising or falling edges of a pulse on Atmega328. I also have an distance sensor that outputs distance in a form of a pusle length (147us = 1inch). But now i cant figure how to config ICP to capture first rising edge and then also the falling edge of the signal. Is the ICP even capable of doing this? Or should i simply read if input pin on MCu is high and count timer pulses until the pin goes low?