Hi All
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:
#include <avr/interrupt.h>
#include <avr/io.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <EEPROM.h>
#include <stdbool.h>
#include "TimerOne.h"
#include "I2Cdev.h"
#include "MPU6050.h"#define USART_RXC_vect _VECTOR(18) // USART Rx Complete ISR
ISR(USART_RXC_vect)
{
}
void setup()
{
}void loop()
{
}
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"
Used: C:\Program
Multiple libraries were found for "Wire.h"
Used: C:\Program
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)