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.
jsotola
1,5442 gold badges12 silver badges20 bronze badges
asked Oct 17, 2020 at 4:56
2
  • you asked for help with nonexistent code Commented Oct 17, 2020 at 5:30
  • It would help if you could put the code inside the question. Did you install the DRV2605 library correctly? Commented Oct 17, 2020 at 7:51

1 Answer 1

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.

answered Oct 17, 2020 at 11:08
1
  • Thank you for your help! I got it! Commented Oct 18, 2020 at 22:13

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.