Robotics Enthusiast
Robotics Enthusiast

Reputation: 1

Issue with compiling Arduino IDE sketch, gets * multiple definition of `__vector_15' * error

I got this sketch from internet and am trying to implement the same code. Source of sketch files: https://github.com/Robin61/Arduino-Pixy2-Dobot-Magician-Pick-and-Place https://github.com/charmedlabs/pixy2/raw/master/releases/arduino/arduino_pixy2-1.0.3.zip

I am trying to integrate Pixy2 with a 4 DOF Robotic Arm named Dobot Magician. This Robotic arm can be controlled via Arduino Mega microcontroller as well (By default, it is controlled using a software "DobotStudio" provided by Dobot itself).

Tutorial Source: https://uptimefab.com/2019/10/02/how-to-make-a-robot-vision-system-with-the-pixy-2-camera/

When I try to upload the Grab_Parts.ino to the Arduino Mega, it gives the following error:

libraries\Pixy2\ZumoBuzzer.cpp.o (symbol from plugin): In function buzzerSequence': (.text+0x0): multiple definition of __vector_15' sketch\FlexiTimer2.cpp.o (symbol from plugin):(.text+0x0): first defined here collect2.exe: error: ld returned 1 exit status exit status 1 Error compiling for board Arduino Mega or Mega 2560.

I want to sort this issue as soon as possible. I am a beginner level user of Arduino boards and IDE. Please do comment if the issue is not clear enough or any information is missing. This is my first time using stackoverflow community as well.

Upvotes: 0

Views: 445

Answers (1)

Robotics Enthusiast
Robotics Enthusiast

Reputation: 1

**

Solved the issue

**

The FlexiTimer2.cpp file uses timer2 and the ZumoBuzzer.cpp file used timer2 or timer4. I figured the cause of the error is when both the files use same timer. Hence, I commented out all the lines in ZumoBuzzer.cpp that is related to timer2, so that it uses timer4 by default. After doing this, it compiled successfully without error. Hope this will be helpfull to anyone in future!

Upvotes: 0

Related Questions