This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sending sensor data over bluetooth

Hello,

I am using nrf52840 dk and ses. I have written the code for hcsr04 ultrasonic sensor and I getting proper values but I want to send this data over bluetooth and I was thinking about using ble_app_uart but I don't know what configurations needs to be done to that code so that I could use it. It would be great if someone could guide me.

Thanks.

Parents
  • Hi. 

    The ble_app_uart example could be a good place to start. 

    There shouldn't be any changes or configurations needed if you already have your sensor data available for your application. 
    I suggest that you take a look at the uart_event_handle() in the main.c file of the ble_app_uart example; 

    uart_event_handle()
    This function will receive a single character from the app_uart module and append it to a string. The string will be be sent over BLE when the last character received was a 'new line' '\n' (hex 0x0A) or if the string has reached the maximum data length. 

    Best regards, 
    Joakim

Reply
  • Hi. 

    The ble_app_uart example could be a good place to start. 

    There shouldn't be any changes or configurations needed if you already have your sensor data available for your application. 
    I suggest that you take a look at the uart_event_handle() in the main.c file of the ble_app_uart example; 

    uart_event_handle()
    This function will receive a single character from the app_uart module and append it to a string. The string will be be sent over BLE when the last character received was a 'new line' '\n' (hex 0x0A) or if the string has reached the maximum data length. 

    Best regards, 
    Joakim

Children
Related