CY8CKIT-031 PSoC® CapSense® Expansion Board Kit Guide, Doc. # 001-66474 Rev. *H
19
Code Examples
4.3
Code Example 2: SLM_USB
Note
The code example requires an USB cable to be connected from the PC to the USB connector
on the board.
4.3.1
Project Description
This example shows the CapSense Linear Slider Module (SLM) interfacing with the development kit
(CY8CKIT-001, CY8CKIT-030, or CY8CKIT-050LP) through the PSoC CapSense Expansion Board.
The example demonstrates the CapSense slider and button combination. The SLM module has 10
element slider and five buttons. The module also has five LEDs. Touch a button on the module to
turn on the corresponding LED; placing a finger on the slider, turns on the LED nearest to the finger
position. The example also shows a media player application in the PC with buttons and slider on the
CapSense SLM as media control buttons.
The project uses the auto-tuning feature (i.e., the tuning method is set to Auto (Smart-Sense) in the
Capsense component), which sets all CapSense parameters to the best values automatically. The
USBFS user module is configured as a HID keyboard. The buttons and slider on the SLM are used
as controls for the media player as follows.
BTN0 Play/Pause
BTN1 Stop
BTN2 Mute/UnMute
BTN3 Next Track
BTN4 Previous Track
Slider Left/Right - System Volume UP/DOWN
The code waits for the USB cable to be connected to the PC from the USB connecter on the board
(USB connector J2 on CY8CKIT-030/CY8CKIT-050LP and USB connector J9 on CY8CKIT-001).
The code proceeds to CapSense sensor scanning only if the USB enumeration is successful. When
the USB enumeration is successful, the LED4 on CY8CKIT-030/050 and LED1 on CY8CKIT-001 (a
jumper wire connection to P1_6 is required) on the board turns on.
The example is tested to work without any overlay. When overlay is used, the sensitivity parameter
should be changed appropriately for Capsense to work. To configure the Sensitivity parameter,
double-click on the
CapSense_CSD
component. Click on the
Scan Order
tab. Select the individual
CapSense sensor and configure sensitivity as required.
4.3.2
Hardware Connections
For the PSoC Development Kit (CY8CKIT-001)
■
Connect the CapSense Linear Slider Module to connector J2 of the PSoC CapSense Expansion
Board.
■
Connect J1 of the PSoC CapSense Expansion Board Kit to port A of the development kit.
■
Connect J2 on the CapSense Linear Slider Module to short SHIELD and SHLD.
■
Connect the USB cable from J9 on the development kit to the PC USB port.
■
Connect P1[6] to LED1. This LED is named Enumerate_LED and indicates that USB enumera-
tion is complete.
For the PSoC 3 or PSoC 5LP Development Kit
■
Connect the CapSense Linear Slider Module to connector J2 of the PSoC CapSense Expansion
Board.