Announcements
Community Announcement : Welcome to the NEW Cypress Developer Community.
cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

sdkadu
New Contributor II

 

I was trying to use the following function to get the capacitance reading:

Raw_padVal[1] = CapSense_1_GetSensorCapacitance(CapSense_1_BUTTON0_WDGT_ID,CapSense_1_BUTTON0_TX0_ID, measurementStatusPtr);

However, I was got stucked in infinite loop 

sdkadu_0-1625277749513.png

I also try to use this pointer to get the capacitance Raw_padVal[1]= CapSense_1_BUTTON0_PTR2SNS_CP_VALUE[0]; But I get the following error:

sdkadu_1-1625277889280.png

 

I have attached the project to this post, any help will be greatly appreciated 

0 Likes
1 Solution
Hari
Moderator
Moderator

Hi @sdkadu 

 

The issue is caused since you are passing the pointer without assigning it to a memory location. Can you please declare measurementStatusPtr as a normal variable and pass the address to the function. 

 

Line #15 would change to 

CapSense_1_TST_MEASUREMENT_STATUS_ENUM measurementStatusPtr;

 

and line #73 would change to 

Raw_padVal[2] = CapSense_1_GetSensorCapacitance(CapSense_1_BUTTON0_WDGT_ID,CapSense_1_BUTTON0_TX0_ID, &measurementStatusPtr);

 

Can you please try this out and let us know if it works?

 

Best regards, 
Hari

View solution in original post

1 Reply