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.
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.
Hi,
It looks like the board has a I2C interface. You can start out with the TWI sensor example. We do not have any specific examples interfacing with these sensors. You will have to read the datasheet of the devices and modify the example to read/write the correct registers to get the sensor data that you want.
Best regards,
Jørgen
Hi,
It looks like the board has a I2C interface. You can start out with the TWI sensor example. We do not have any specific examples interfacing with these sensors. You will have to read the datasheet of the devices and modify the example to read/write the correct registers to get the sensor data that you want.
Best regards,
Jørgen
i am new to this board
how to understand the TWI sensor example code.
these gy-80 also has SCL and SDA pins how to interface it.
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.