To use CSD matrix buttons, you have to configure the CSD component (double click and make changes) to a have a 3x3 matrix widget. In the main.c the basic APIs for CAD will be same. In the place of check the status of the button you have to use the following API
CapSense_GetMatrixButtonPos(uint8 widget, uint8* pos)
This API will return 1 if any button is pressed also the position will be available in pos variable. You may find more abut this API in the component datasheet.
1 of 1 people found this helpful
You can easily configure matrix in CapSense module by selecting matrix in CapSense block GUI in PSoC creator.
Please go through the code examples and Cypress recommended layout pattern for CapSense Matrix sensors downloadable from the link below.
Thanks you !
But I don't know how use this function : CapSense_GetMatrixButtonPos(uint8 widget, uint8* pos). What parameters I have to place in this function. I read the datasheet and I don't understand it.
Thank you for your time !
Please find the attached example PSoC Creator project. It has the the code that tells you how to use the CapSense_GetMatrixButtonPos() API. Please ensure right pins for colums and rows for your project. Please go through the comment lines in the project for understanding the API.
matrixexample.zip 1.0 MB