This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cannot add function in main.c

Hi, I would like to ask that, whenever I put my function in main.c, the borad become undiscoverable.

I'm using nRF51 with ble_app_uart_s110_pca10028, and below are my function and main

image description image description

Parents Reply Children
  • Hi caram5555, cause I'm just a beginner, so I just follow the example, is there any better way to transmit data using UART?

  • Hi 10Hsin. In your sample program, it constantly transmitting data between 0 to 9. The most important thing is why? Why you transmitting data 0 to 9 to one-side without any event or case? I mean .. transferring data is communication with your friends. Imagine this situation,

    1. you are designning sensor device(BLE UART) that can communicate with your smartphone(Central).
    2. your smartphone connect to your device and send a command to retrieve sensor value.
    3. your device wait for a command
    4. if your device received a sensing command, then your device write data using ble_nus_stringxxx

    Best regards.

  • In my case, nRF51 acts as an sensor and keep transmitting data, 0-9 are just fake data. After I retrieve data, I'll send it to a platfrom for futher process. But besides 0-9, I still send strings for some specific purpose, so I use uart example. (I use hrs example before)

  • Ok. Then I suggest you transmit your sensor data periodically using timer or delay.

Related