This project is designed to recognize the gesture which user makes on the touch pad which is a CapSense element of PSoC based boards. In this project WS2812 is used for sequencing application to demonstrate clockwise and anticlockwise movement of finger position on CapSense. When a user moves the finger clockwise, the LED would sequence clockwise while when the user moves finger anticlockwise the sequencing would follow anticlockwise.
I decided to make this project when I heard about WS2812 and its feature. This tempted me to go for it. Apart from this CapSense element from PSoC is also something which is intriguing because of its immense capabilities. The end result which we get out of it is extremely satisfying.
CY8CKIT-044 board contains a radial CapSense element which can be used to develop multiple applications which includes gesture recognition. This feature can be used in multiple applications like music player, home automation etc. A special function LED namely “WS2812” is a serial in serial out based LED which is capable of interfacing as many LEDs as possible with the hardware using a single port of the microcontroller. This certainly gives an advantage of interfacing multiple LEDs using a single port giving many GPOIs available for other operations. However the complexity of programming cannot be neglected. In case of other platforms like Arduino or PIC controllers, interfacing this LED ring could be a tedious task as one needs to write the entire address based code to actually make use of the facilities this LED can provide for various applications. However, in case of PSoC, there is a component library available for this LED which converts the entire addressing mode into simple numbering of positions of LED i.e. 1,2,3, etc., which is the actual position of the LED on board making programming of the LED very easy.
Another advantage of WS2812 is that using a single port RGB can be implemented for multiple LEDs in string with very high brightness. PSoC component takes entire care of interfacing RGB addressing into simple naming of colors in the code again making it a very user friendly hardware software interface. This has been possible by using the PSoC Component library and API as well as code snippet for WS2812 in PSoC Creator by Mark Hasting. The link can be used to get started with it.
Capsense Gesture.h
and LED Control.h
files from the CapSense example project of CY8CKIT-044 can be used as a starter to get all the configuration setup and therefore can be modified for this application. This project aims at only single color however one can use the APIs provided by Mark Hasting to get RGB configurations too.
PSoC creator firmware designing is unique in its own way of dragging the components and configuring them. Figure 2 shows the components required for coding this project. The project file comes with pre-configured components so user need not reconfigure it. StripLights component is used to declare the frequency of operation as well as declaring the number of LEDs which is going to be used. In this case it is 16.
In the code snippets provided by Mark Hasting switch has been configured so I have retained that component in case someone wants to do experimentation with this project. However in this project switch has not been used. After configuring this we need to set up the pin assignment. Figure 1 shows the pin assignment of the same. Though these pin assignments are with respect to CY8CKIT-044 one can even configure this project for all other Cypress boards by changing the Pin Assignments with respect to those boards.
Figure 3 shows the connection diagram of the system.
Comments
Please log in or sign up to comment.