Count time after pushing button | Cypress Semiconductor
Count time after pushing button
I want to count 2 minutes after I push a button. I do it that way:
- I'm always checking the state of the button on the main loop, so that if it gets pressed I do "Timer_1_Start();".
- Timer1 is configured (Trigger mode none, Capture mode none, Enable mode Software only and Run mode Continouos).
- In the "tc" output of the Timer1 I connect a Interrupt component "isr_1", so that when timer1 is time out I do "Timer_1_Stop();" and other tasks.
Is there anyway to do this simplest ? Maybe configuring One shot Run mode on Timer1 ?
Thank you !!