Forum Discussion
Altera_Forum
Honored Contributor
14 years agoFew ideas :
1. Your program executes once and then exits. You have to put your test in a loop such as while(1). 2. When configuring the PIO Core, have you well enabled the edge capture ? On both edges ? 3. To detect both edges (button pushed and button released) you must change the if else operation you did, because the if tells you if you have a transition (it can be a rising or a falling edge), the else will thus be executed always if you don't touch the button. So inside, the if, you should have a second test to check the current value on the port to determine if it is was rising (1) or falling (0) transition.