event function

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi Guys,
I would like to ask about the event function/on pressing a button either button 1 or button 2 and start counting.
or can remember the last event let say transition from 0 to 1 is counted 1 event,
if the event 0 to 1 happen again, counted to be 2. and so on
The program is about when i press a button (press and release it), the program start counting/ incrementing.
for example :
int=1;
if (pressing a button1)
{
n++;
}

or any OnClick function in this apps??
thanks for help guys..

Regards,
Ali
0 Likes
1 Reply
elegantk
Employee
Employee
You can use the CNT001 and IO002 App.
Refer to the help guide for CNT001 app to connect the virtual signal to the IO002 app.

For more information, you can download the project example for counter app.

Help >> Install DAVE Apps/Example Library
In the "Work With" dropdown list, choose "DAVE Project Library Manager"

XM4500 >> XMC4500 Series >> DAVE 3 example project with DAVE Apps >> Timed-Input-Output >> PWM
There is an example "PWMSP001_CNT001_Example1".
0 Likes