This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Could I ask for a CC2540 sample code ?

Other Parts Discussed in Thread: CC2540

Could I ask for a sample code that using keyfob's button to control usb dongle's LED on & off?

I have no idea how to start with cc2540.


I'm a Taiwanese beginner. 

thanks.

  • Hi Weng Jine He :)

    No problem, nobody is born with programming skills.

    Let's try to introduce you in the world. First, download the BLE Stack. There are LOTS of codes there!

    http://www.ti.com/tool/ble-stack

    To understand what you are doing, you should first read the software developer's guide, since you wanna be one of them :)

    http://www.ti.com/lit/ug/swru271b/swru271b.pdf

    The LED thing you wanna do can be easily done by opening the Keyfob or SimpleBLEPeripheral project (one of both) into IAR (the development environment). The projects are separated in multiple "layers" so people not interested in hardware, for example, do not have to deal with it :)

    Why don't you take a look to the file "hal_key.c" and try to identify the place where a button is detected to be pressed? Then, a simple line of code will do what you want.

    Go for it. And good luck! And go back with all the questions which arise.

  • Thanks for your suggest, Kazola.

    I will try what you say.

    But, I think I will have a lot of questions on it in the future.

  • This is way this forum exists :)

  • hi kazola,        can u please help me by briefly telling the steps i need to do for interfacing msp430 with cc2540 so dat data must be sent via bluetooth. cc2540 must be configured in slave mode right? and i am not getting how to start with programming cc2540. please help me, i am new to this field.