Specifications
CY3214-PSoCEVALUSB Kit Guide, Doc No. 001-67030 Rev. *B 51
Code Examples
4. LED2 glows when CapSense button P37 is touched.
Figure 5-37. LED2 Glows for Button P37
5. Save and close the project.
5.2 Buttons and Lights Example
5.2.1 Project Description
This code example demonstrates the USB function using the CY3214-PSoCEVALUSB Kit. In this
project, the Buttons and Lights PC Host GUI is used to control the LEDs on board. The GUI also has
four soft buttons and four LEDs. When there is a button press event on the board, the board sends
out the buttons report to the GUI. The GUI updates the local LEDs and sends out a Lights report
back to the board. The LEDs on the board are updated based on this Lights report. The GUI also
provides the LED output as a logical function of soft buttons and buttons on board. The LED output is
a function of 'AND' or 'OR' of soft buttons and real buttons. By default, the LED output is that of real
buttons The following module is used in the project:
■ USB: This module handles requests from the USB host (PC) to communicate with the device. It
handles data packet transfer between the host and device connected to host through USB.
5.2.2 Hardware Connections
■ Connect LEDs 1-4 to P3.2 to P3.5 (P32 to P35 on connector J10).
■ Port pins P2.2 to P2.5 (P22 to P25 on connector J12) are configured as active-low buttons in
firmware. To simulate a button press connect the required port pin to ground (terminal marked '-')
on connector J11.