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.
New contributor
ynava is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • you asked for help with nonexistent code – jsotola 2 days ago
  • It would help if you could put the code inside the question. Did you install the DRV2605 library correctly? – StarCat 2 days ago
1

“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.

| improve this answer | |
  • Thank you for your help! I got it! – ynava 17 hours ago

Your Answer

ynava is a new contributor. Be nice, and check out our Code of Conduct.

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.