The Capacitive Sensor driver example demonstrates how to use the Capacitive Sensor driver in practice.
The example initializes the Capacitive Sensor driver to constantly monitor the level of the analog input 1 (AIN1) and the analog input 7 (AIN7). If the measured value rises above the threshold level on AIN1, LED 1 lights up. If the measured value rises above the threshold level on AIN7, LED 3 lights up.
To run this example, you will need some kind of capacitive pads. These can be made, for example, of aluminum foil.
You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\peripheral\csense_drv
Test the Capacitive Sensor driver example application by performing the following steps:
If LEDs are not lighting up when the pads are touched, or are lit right after initialization, try changing the THRESHOLD_VALUE_PAD1 value and the THRESHOLD_VALUE_PAD2 value in the main example file. If LEDs are not reacting to touch, you must decrease these values, and if LEDs are already lit up, you need to increase them. You can also try entering configuration mode, where thresholds values will be configured for you.