I am trying to have the LED stay on for 5 seconds after I push the button on the cy8ckit-049-42xx prototyping kit.Currently, it works the first time I push the button but the next time the LED stays on forever. I am using Win 7 and PSoC Creator 4.1.
Here is the relevant code.
CyGlobalIntEnable; /* Enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
int Flag = 0;
if(!SW2_Read() && !Flag)
Flag = 1;
// My_Timer_Init(); // Makes no difference
I have attached the code bundle.
Thank you for your kind help.