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

BLE accelerometer

Greetings,

I'm using nRF52 DK to transfer LIS3DH accelerometer data in Bluetooth. I successfully managed to establish an I2C connection with my sensor, I get my XYZ values. Now I want to send the data in Bluetooth, I'm a bit confused about what to do next. Is there any example program in SDK that will help me? or if you can suggest to me some tutorial that would be helpful too. I'm a beginner, so any advice or suggestions are welcome. Thank you.

Parents Reply Children
  • Karthiknk said:

    Are you checking error codes from all softdevice APIs you are calling in your application?

    Yes I guess, I didn't change anything in the app_template example regarding error check. 

    I was thinking more about the code that you added from the tutorial, that you have remembered to store the return code from all function calls, and pass this along to APP_ERROR_CHECK() macro.

    Karthiknk said:

    And in nRF connect log. I get error 133 (0x85): GATT ERROR

    didn't this log information helps in any way?

    Unfortunately, this is a very generic error code. It can be caused by a lot of things. Can you post the full log output from nRF Connect? A sniffer trace will also tell if the peripheral did not respond to packets, etc.

  • Hi Jorgen. While setting up sniffer, programming my nRF52 DK, I accidentally put my DK in bootloader mode. How can I bring it back to normal? I can not see the device in nrf connect.

  • Hi, I found the problem. The device is advertising, When I connect to the nRF Connect application, I can not see my service, the status says disconnected. 

    This is the timer event handler I use in the program

    static void timer_timeout_handler(void * p_context)
    {
    // Acquire accelerometer data
    MPU6050_ReadAcc(AccValue); // accelerometer read
    acc[0] = AccValue[0];
    acc[1] = AccValue[1];
    acc[2] = AccValue[2];

    characteristic_accel_update(&m_our_service, acc);
    }

    If I  line comment my accelerometer read function, The app works fine, I can see the service and its characters at the nrf connect(without accel. values). How can I include my accelerometer read function into my program without crashing the app? 

  • Im happy to say that the project is complete. Thank you for your support. You may close this ticked.

Related