[ Ссылка ]
Hello, my name is Alan Hawse. I’m Vice President of Technical Staff for Solutions and Software at Cypress Semiconductor.
In the last lesson we did the first half of a Find Me application. First we created a new PSoC4 BLE design and then we configured the BLE component.
Recall that I talked about GAP- the mechanism by which devices connect. And I talked about GATT – which is the mechanism by which devices exchange data.
I also talked about Profiles, Services and Characteristics. Recall that our Find Me peripheral will have an Immediate Alert Service that contains and Alert level characteristic.
[ Ссылка ]
In this lesson we will take the Find Me profile that you configured in the first lesson as well as add a little bit of firmware that is required to make it work on the PSoC 4.
You’ll remember that we chose the Find Me profile, then gave the device a name and asked for a unique ID, and finally we asked for the name and the service UUID to be included in the advertising packet.
One thing that makes BLE a little different from other PSoC Creator components is the number of APIs that are needed to support all of the configurations and services. To help you navigate these APIs we added a browsable Help window showing all of them.
It’s a good way to learn about the component firmware and find the right API for your needs. I recommend you open it every time and refer back to it as you write your C code.
At this point we have a BLE component that is configured and ready to go.
First, let’s add a pin to the project that we will use to drive an LED based on the Alert level I get from the phone.
I would like to have the LED be off when there is no Alert, blinking with mid Alert and solid with high Alert.
I will use one of the TCPWMs to perform this function.
Add the TCPWM to your design and configure its period to be 1000 and its compare to be 0. Then add a 1khz clock to drive it.
Lastly wire the LED to the line_n output of the TCPWM. A little bit later we will write the firmware to implement this blinking pattern.
Watch the video to finish this project
In the next lessons I will add another service to this application, I’ll talk more about GATT and GAP, and talk about power and lastly I’ll show you an example of a custom service.
As always you are welcome to email me at alan_hawse@cypress.com with your comments, suggestions, criticisms and questions.
Ещё видео!