I am working on MPU6050 sensor integration with Arduino Uno and I have started up building a project around it (mpu-6050.zip file attached).
For that, I am using standard MPU6050 and I2Cdev libraries. I do not want to use the builtin Arduino library of Serial. I am defining own USART Receive interrupt.
Here is my start up mpu-6050.ino code for testing:
#define USART_RXC_vect _VECTOR(18) // USART Rx Complete ISR
While compiling this, I am getting following errors:
HardwareSerial0.cpp.o (symbol from plugin): In function `Serial’:
(.text+0x0): multiple definition of `__vector_18’
sketch\mpu-6050.ino.cpp.o (symbol from plugin): (.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for “EEPROM.h”
Multiple libraries were found for “Wire.h”
exit status 1
Error compiling for board Arduino/Genuino Uno.
If I remove my own USART Receive Interrupt definition, the code gets compiled successfully.
My query is: Do I2C, TimerOne and USART conflict while being used in the same code in Arduino? I am asking this because my USART interrupt method is working fine individually (Please find the project “Serially_Controlled_DO.zip” attached herewith).
mpu-6050.zip (48.8 KB)
Serially_Controlled_DO.zip (1.12 KB)