Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
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.