i have project app_ble_uart and i want add to it functin read from mpu6050 i add to Makefile Makefile pathes and add #include "mpu6050.h" and InitMPU6050(0x68); into main main.c but i have error
./../../main.c: In function 'main': ../../../main.c:653:5: error: implicit declaration of function 'InitMPU6050' [-Werror=implicit-function-declaration] InitMPU6050(0x68); ^~~~~~~~~~~ cc1.exe: all warnings being treated as errors make: *** [_build/nrf52832_xxaa_main.c.o] Error 1 ../../../../../../components/toolchain/gcc/Makefile.common:134: recipe for target '_build/nrf52832_xxaa_main.c.o' failed
What i do wrong?
Hi,
Are you trying to include the MPU6050 driver that is present in the SDK? This driver does not have any functions with the name InitMPU6050. Try with mpu6050_init(0x68) instead.
InitMPU6050
mpu6050_init(0x68)
If you are trying…
Sorry, I did not know that the MPU6050 driver did use a deprecated TWI driver. I do not recommend using this. Please have a look at this thread. You should be able to rewrite the driver to work with the…
If you are trying to add another MPU6050 library, you need to include the path to the correct header files in your Makefile.
Best regards,
Jørgen
ok it is my error
but i fix it and add new patchs into Makefile
$(SDK_ROOT)/components/drivers_ext/mpu6050/mpu6050.c \ $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated/twi_hw_master.c \ $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated/twi_sw_master.c \ $(SDK_ROOT)/components/libraries/uart/app_uart_fifo.c \
and
$(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated/config \ $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated \
and i have error
../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c: In function 'twi_master_write': ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:81:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER' NRF_TWI1->POWER = 0; ^~ ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:83:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER' NRF_TWI1->POWER = 1; ^~ ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c: In function 'twi_master_read': ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:154:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER' NRF_TWI1->POWER = 0; ^~ ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:156:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER' NRF_TWI1->POWER = 1; ^~ ../../../../../../components/toolchain/gcc/Makefile.common:134: recipe for target '_build/nrf52832_xxaa_twi_hw_master.c.o' failed make: *** [_build/nrf52832_xxaa_twi_hw_master.c.o] Error 1
what i neуd to do?
Sorry, I did not know that the MPU6050 driver did use a deprecated TWI driver. I do not recommend using this. Please have a look at this thread. You should be able to rewrite the driver to work with the standard TWI master driver, without too many changes. I would also recommend you to take a look at this GitHub repository by Martin, which contains drivers and examples for various MPU models.
ok thank you