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

BLE_NUS can only send integer, cannot send float values

I'm using nRF52 DK to send SAADC data to mobile app "nRF Connect" over BLE. 

I'm using this code to send the data, but the mobile app "nRF Connect" can only show integer values, cannot show float values. please help, thanks! 

int iii = 35;
float fff = 0.123456789;

uint8_t nus_string[50];
bytes_to_send = sprintf(nus_string, "int = %d, float = %f\r\n",iii,fff);

err_code = ble_nus_data_send(&m_nus, nus_string, &bytes_to_send, m_conn_handle);

if ((err_code != NRF_ERROR_INVALID_STATE) && (err_code != NRF_ERROR_NOT_FOUND))
{
    APP_ERROR_CHECK(err_code);
}

Related