- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to run a proximity sensor using CY8C4025LQI-S411 chip. I've created a CapSense component, configured it to use a proximity sensor with two sensors, shield and shield tank capacitor - all according to the hardware design on hand. However, I don't seem to get any response from the IsProximitySensorActive method. I can see the measurements change when I move my hand over the sensor, using the sensors' raw data directly; however, no matter how I change the configuration or program code, I can't get the CapSense working.
How do I know if I should change the CapSense component configuration, program code or hardware design? What do I have to do to determine the source of the problem?
Below is the source code of main() function that I'm currently using. Is there anything wrong with it?
CapSense_1_CSDSetupWidget(0);
CapSense_1_Start();
CapSense_1_InitializeAllBaselines();
for(;;)
{
CapSense_1_ProcessAllWidgets();
while (CapSense_1_IsBusy())
{
;
}
CapSense_1_UpdateAllBaselines();
if (CapSense_1_IsProximitySensorActive(0, 0))
{
Pin_1_Write(1);
}
else
{
Pin_1_Write(0);
}
CyDelay(5);
}
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Tags:
- capsense proximity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I see that you have not scanned your proximity sensor. You need to scan after setting up the widget. Then, check until the scanning is complete (while loop), followed by processing of the widget.
You can refer to code examples CE210291 or CE210289.
You could also refer to Scan APIs in the the CapSense component datasheet.
Thanks,
Shanmathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Proximity sensors have to be enabled first, before they can be red using IsProximitySensorActive() API.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I see that you have not scanned your proximity sensor. You need to scan after setting up the widget. Then, check until the scanning is complete (while loop), followed by processing of the widget.
You can refer to code examples CE210291 or CE210289.
You could also refer to Scan APIs in the the CapSense component datasheet.
Thanks,
Shanmathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! I actually was scanning the component once, but one wasn't set up correctly at the time and the Scan() method got lost somewhere in the experiments.
Following your guideline made it actually work.