Hello!
Today’s example demonstrates how to control an RGB LED using the XBee wireless network. In this example the user will be able to scroll through LED colors using the switch, and selecting the brightness using the CapSense controller. The following hardware will be used:
- CY8CKit-042 (x2) Buy Now!Buy Now!
- Custom Wireless Boards (x2) Buy Now!Buy Now!
- XBee wireless module (x2) Buy Now!Buy Now!
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Zip File of Images
- Project Schematic
- Component Configurations
Components Used:
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
- Transmitter
- UART
- CapSense
- CyPin
- Reciever
- Three PWMs
- UART
- CyClock
- CyPin
The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.
Firmware Description:
The main.c firmware is included in the example project. Please review the commented sections for more details.
This example project requires two separate firmware projects, one for each Pioneer kit. One pioneer kit will serve as the TX module and the second pioneer kit will serve as the RX module. In the attached zip file our example project contains two example projects in the workspace explorer (RX and TX). Each project needs to be built and programmed in their respective unit. It might be helpful when examining this project to mark on your respective kit which functionality it contains (RX or TX).
Please refer to examples #024 and #026 for XBee module configuration. Please follow those steps to create the wireless network.
The RGB LED brightness on the CY8CKit-042 (receiver) is controlled using the CapSense slider and user switch of the other CY8CKit-042 (transmitter). The RGB LED color on the receiver changes through a set of different colors when the user presses the switch on the transmitter. A long press on the transmitter switch causes the receiver to automatically change through different colors until a new input is received.
In the video below of the example we are using custom Shield boards. In this example the engineer used two breadboards and soldered a connector and wires to connect the XBee module. Both of these examples use the 6 pin Pmod compatible header (please refer to the kit user guide for more information). In this example we’ve soldered a small header onto the 6 pins to connect the custom board. If you have a wireless shield then simply change the pin selections in the DWR window for both projects.
Hardware Connections:
For this example you will need the following hardware:
- Two Pioneer Kits
- Two Custom Wireless Boards
- Two XBee wireless modules
Wire up the XBee wireless modules to the custom protoboard using the following layout. The protoboards linked above might be cut down to save size.
Test Your Project:
Once you have configured the wireless modules, programmed your PSoC 4s, and connected your wireless modules, begin by pressing the SW2 button on the transmitter board.
Using your finger move across the CapSense slider to change the receiver’s RGB LED brightness.
Hold down the SW2 button to scroll through the LED colors, pressing the SW2 button to stop the scrolling.
I hope this example can help you in your design.
Best,
Matt



