8 years, 4 months ago.

Is there any code where I can attach function by sensing input pulses on interrupt?

I want to call a function when my input pulses have stopped. I have an InterruptIn bound to a pin which gives me a pulse train. I want to sense when the pulse train has stopped and call a function after a wait.

Please help,

1 Answer

8 years, 4 months ago.

One option: In your InterruptIn handler add a Timeout (which is defined globally, so on top of your file) that is called after a certain time. As long as your InterruptIn's get called the TimeOut will be reset every time, otherwise after a while it will be called.

Accepted Answer

while(counter++){ function; } function;

will this work?

posted by jayendra mishra 04 Jul 2016

What is it supposed to do? I don't see how that would work.

posted by Erik - 04 Jul 2016