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 must calibrate your hardware setup right before running this example because the risk is high that the example will not work correctly. To do this, you can use the calibration
command in the console. Run the command and follow the instructions that appear in the console. Values measured by the calibration
command can be used to configure this example statically in the code. To do this, change the THRESHOLD_VALUE_PAD1 and the THRESHOLD_VALUE_PAD2 in the main example file according to the values measured by the calibration
command.
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: