1

I found this Haptic Headband project on YouTube (link below) and I am trying to verify the code that was given in the instructions with the Arduino IDE. However, I keep getting the message below and am not too sure what I need to do to fix it. I'd appreciate any help I could get to solve this issue.

I have also attached a pdf of the instructions with the code to use for the headband.

PDF: https://cdn-learn.adafruit.com/downloads/pdf/haptic-headband.pdf?timestamp=1602887165

https://www.youtube.com/watch?v=xD7bfBx5D9M&ab_channel=AdafruitIndustries


libraries\Adafruit_DRV2605_Library\Adafruit_DRV2605.cpp.o (symbol from plugin): In function `Adafruit_DRV2605::Adafruit_DRV2605()':
(.text+0x0): multiple definition of `Adafruit_DRV2605::setRealtimeValue(unsigned char)'
sketch\Adafruit_DRV2605.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries\Adafruit_DRV2605_Library\Adafruit_DRV2605.cpp.o (symbol from plugin): In function `Adafruit_DRV2605::Adafruit_DRV2605()':
(.text+0x0): multiple definition of `Adafruit_DRV2605::useERM()'
sketch\Adafruit_DRV2605.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries\Adafruit_DRV2605_Library\Adafruit_DRV2605.cpp.o (symbol from plugin): In function `Adafruit_DRV2605::Adafruit_DRV2605()':
(.text+0x0): multiple definition of `Adafruit_DRV2605::useLRA()'
sketch\Adafruit_DRV2605.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 Uno.
2
  • you asked for help with nonexistent code – jsotola Oct 17 '20 at 5:30
  • It would help if you could put the code inside the question. Did you install the DRV2605 library correctly? – StarCat Oct 17 '20 at 7:51
2

“Multiple definition” means that you have something defined more than once. According to the error message, some methods are defined both in libraries\Adafruit_DRV2605_Library and in your sketch folder.

It looks to me like you are trying to use two copies of the Adafruit_DRV2605 library. One of them is properly installed as a library, and the other is within your sketch folder. You don't need two copies. If the library is properly installed, there is no point in copying its source files to your sketch folder. Get rid of that extra copy and try recompiling.

1
  • Thank you for your help! I got it! – ynava Oct 18 '20 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.