Specifications
CY8CKIT-042 PSoC 4 Pioneer Kit Guide, Doc. # 001-86371 Rev. *D 53
Code Examples
5.3.4 Verify Output
Build and program the code example, and reset the device. LED is on for one second and turns off,
which indicates that the device has entered Deep-Sleep mode. Press SW2 switch to wake up the
device from Deep-Sleep mode and enter Active mode. The device goes back to sleep after one sec-
ond.
Note: When the device is in Deep-Sleep mode, the programmer must reacquire the device before
programming can start.
5.4 Project: CapSense
This code example can be executed in two ways – with and without CapSense tuning. The same
project can be used to demonstrate the CapSense functionality as well as CapSense tuning using
the Tuner Helper GUI in PSoC Creator. This is done by commenting and uncommenting the line
#define ENABLE_TUNING in the main.c file of the code example. PSoC Creator does not compile
the code under the #ifdef (if defined) statement when the #define statement is commented (/
*…… */ or //). Similarly, when the #define statement is uncommented, the code required for work-
ing with Tuner GUI is compiled. By default, the project is set to work without CapSense tuning by
commenting the #define.
5.4.1 CapSense (Without Tuning)
5.4.1.1 Project Description
This code example demonstrates CapSense on PSoC 4. The example uses the five-segment
CapSense slider on the board. Each capacitive sensor on the slider is scanned using Cypress’s
CapSense Sigma Delta (CSD) algorithm implemented in the CapSense component. This project is
pre-tuned to take care of the board parasitics. For more information on the CapSense component
and CapSense tuning, see the CapSense component datasheet in PSoC Creator.
In this code example, the brightness of the green and red LEDs are varied, based on the position of
the user’s finger on the CapSense slider.
Figure 5-17. PSoC Creator Schematic Design of CapSense Project
Note: The EzI2C component is not used when tuning is disabled.