I am using CY8CKIT-042 PSoC® 4 Pioneer Kit. I am using it for the CapSense design with 10 buttons and 2 sliders.
We are observing a delay in sensing the capsense buttons. That means, we are trying to blink led's depends on the button touch and there is a second delay between the touch and led light up.
I am thinking the API's used to find the widget active status is causing it.
Here is a piece of code we are using. Let us know the execution time of these API's and if we have to use any other logic to use with.
/* Mian entry function for CapSense steering wheel swicth */
/* Initialize CapSense Component */
/* Scan all widgets */
/* Do this only when a scan is done */
if(CapSense_NOT_BUSY == CapSense_IsBusy())
/* Process all widgets ( Buttons & Sliders ) */
/* Again scan all widgets */
CapSense_ScanAllWidgets(); /* Start next scan */
CapSense_ProcessAllWidgets(); /* Process all widgets */
if (CapSense_IsAnyWidgetActive()) /* Scan result verification */
flagb0 = 1u;
flagb1 = 1u;
if(flagb0 || flagb1)
/* Light up LED's */
Please let us know the execution time the below API's to conclude on the delay we are facing.
And how we have to handle multiple widgets in a project? Is there anyway to avoid if else condition as above as we have 10+ buttons in the project?