2 Replies Latest reply on Jan 29, 2020 4:39 PM by YuMa_1534086

    Regarding a way to scan only some capsense widgets of all widgets.

    YuMa_1534086

      Hello Cypress.

       

      I would like to scan only some capsense widgets of all widgets.

       

      Attached project has 5 capsense widgets.

      I would like to scan only 2 widgets of button0 and button4.

       

      But only button4 can scan in this project.

      Button0 did not scan.

      I used CY8CKIT-145-40xx.

       

      How should attached project be modified?

       

      Best Regards.

      Yutaka Matsubara.

        • 1. Re: Regarding a way to scan only some capsense widgets of all widgets.
          BragadeeshV_41

          Hi YuMa_1534086,

           

          If you call the API CapSense_SetupWidget(); multiple times (one after the other), then only the widget that is setup last is scanned. For example, in your case, you are setting up the button 4 at last, that is why you see that only button 4 is scanned.

           

          The correct sequence is :

          1. Set up the widget to be scanned using CapSense_SetupWidget();

          2. Start the scan using CapSense_Scan();

          3. Wait for scan to complete using  CapSense_IsBusy();

          4. Process the scanned widget using CapSense_ProcessWidget();

          5. Increment/ Change the widgetID to next widget to be scanned.

          6. Go to step 1.

           

          For example, you can do the following:

           

          widgetID = 0;

           

          CapSense_Start();

          CapSense_SetupWidget(widgetID);

          CapSense_Scan();

           

                    if(CapSense_NOT_BUSY == CapSense_IsBusy())

                    {

                         CapSense_ProcessWidget(widgetID);

                         if(CapSense_IsAnyWidgetActive())

                         { //Application

                         }

                         widgetID ++; // Or the next widget you want to scan.

                     

                         if(widgetID > maxWidgetID) // Based on your application

                         {

                              widgetID = 0;

                         }

                         CapSense_SetupWidget(widgetID);

                         CapSense_Scan();

                    }

           

          Regards,

          Bragadeesh

          • 2. Re: Regarding a way to scan only some capsense widgets of all widgets.
            YuMa_1534086

            Bragadeesh-san.

             

            Thank you for your answer.

            I understand.

             

            Best Regards.

            Yutaka Matsubara