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

i have a nrf52840 dk. i wnt to connect a gy-80 module and get the x, y, z axis

the gy-80 module which has

1.HMC5883L

2.BMP-085

3.L3G4200D

4.ADXL345

i want to get the x, y, z axis of the sensor's position 

which example i have to use and how to modify it.

Parents Reply
  • The example initializes the TWI driver using nrf_drv_twi_init, then use nrf_drv_twi_tx/nrf_drv_twi_rx to write/read registers. The driver works in non-blocking mode, meaning that the CPU can sleep or perform other operations while the TWI peripheral transfers/receives data. When a transfer is completed, an interrupt is generated and an event is passed to twi_handler.

    You need to modify the example to use the TWI address of your sensor and use the tx/rx functions in the correct order to write/read the correct registers according to the sensor's datasheet.

Children
No Data
Related