Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Reading X, Y & Z Values From Accelerometer connected to nRF52840 DK

Hi, 

I was wondering what example to use if I have an accelerometer on a breadboard connected to the nRF52840 DK via TWI/SPI and the DK connected via USB to my Mac? I want to obtain the X, Y and Z values from the accelerometer but the SPI slave and master examples don't mention how to do this. 

Thanks. 

Parents
  • Hi,

    This depends on which accelerometer you want to read data from. You need to read the datasheet of the device to see what commands you need to write to the sensor to configure it correctly and read data. Then you can start out with the SPI master or TWI sensor examples, based on which interface the sensor supports. Both these examples implement logging through NRF_LOG module, either over UART or RTT interface to a PC.

    There are some examples for some MPU accelerometer devices in this repository: https://github.com/Martinsbl/nrf5-mpu-examples, but these are based on an old SDK version.

    Best regards,
    Jørgen

  • Just to let you know, I'm using SES as my IDE but the EV3672 board only mentions how to read values with an Arduino using Keil, although the evaluation board does support the nRF52840. 

Reply
  • Just to let you know, I'm using SES as my IDE but the EV3672 board only mentions how to read values with an Arduino using Keil, although the evaluation board does support the nRF52840. 

Children
No Data