TLC59711 with Adafruit Library and example sketch (compile error)

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ADAFroots
 
Posts: 10
Joined: Sat Sep 10, 2022 1:33 pm

TLC59711 with Adafruit Library and example sketch (compile error)

Post by ADAFroots »

Hello!

I have an Adafruit TLC59711 LED driver that I recently purchased and decided to try it out using the example sketch provided with the Adafruit library.

I've been using this link as a resource - https://learn.adafruit.com/tlc5947-tlc5 ... -and-links

I have everything set up as per the instructions, but when I try to upload the example sketch to the Arduino I'm greeted by the following error message:

"Arduino: 1.8.15 (Windows 10), Board: "Arduino Uno"

In file included from C:\Users\Documents\Arduino\libraries\Adafruit_TLC59711-master\examples\tlc59711test\tlc59711test.ino:18:0:

C:\Users\Documents\Arduino\libraries\Adafruit_TLC59711-master/Adafruit_TLC59711.h:25:10: fatal error: Adafruit_SPIDevice.h: No such file or directory

#include <Adafruit_SPIDevice.h>

^~~~~~~~~~~~~~~~~~~~~~

compilation terminated.

exit status 1

Error compiling for board Arduino Uno."


Is the fix as simple as installing the Adafruit_SPIDevice.h library and replacing...

#include "Adafruit_TLC59711.h"
#include <SPI.h>

with...

#include <Adafruit_SPIDevice.h>

...in the example sketch?

I didn't try it because I'm not 100% certain I've understood the error correctly.

If I needed to install a different library, why is the website linking me to the wrong one? If the other library is required in addition to the one I already have, why is not mentioned anywhere?

I'm a novice and easily stumped when something doesn't work the way it should, but I've tested new components in the past using the manufacturers libraries and example sketches with no problem until now.

This is the first time I've tried anything from Adafruit however.

If anyone knows what's happening, I'd appreciate some help, thank you! :)

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: TLC59711 with Adafruit Library and example sketch (compile error)

Post by mikeysklar »

I did a quick test with my Arduino IDE set for Arduino Uno board like you are using. I was able to compile the example code without issue.

Please try downloading the library through the Arduino IDE:

Sketch --> Include Library --> Manage Library
Screen Shot 2022-09-11 at 9.27.52 AM.png
Screen Shot 2022-09-11 at 9.27.52 AM.png (54.56 KiB) Viewed 189 times
If that resolves it I can update the guide to point at the Arduino IDE method.

User avatar
ADAFroots
 
Posts: 10
Joined: Sat Sep 10, 2022 1:33 pm

Re: TLC59711 with Adafruit Library and example sketch (compile error)

Post by ADAFroots »

Thanks @mikeysklar for the reply!

It turns out I did not have the following library installed -

https://github.com/adafruit/Adafruit_BusIO

It's not mentioned anywhere on the product page and setup guide. I didn't know I needed it until I did some more digging since this is the first Adafruit product I've used. The library includes the Adafruit_SPIDevice.h file which the compiler was searching for.

When I installed the library, the compile worked first time. Regarding the sketch, I did NOT need to add...

#include <Adafruit_SPIDevice.h>

I left the example sketch as it was and it still found the Adafruit_SPIDevice.h file when compiling. Frustrating, but at least it works now! :)

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: TLC59711 with Adafruit Library and example sketch (compile error)

Post by mikeysklar »

Congrats. Glad you got it working and determined which library was necessary.

How had you been installing the libraries? Were you using the built-in library manager like my screen shot shows or did you manually install from github? I ask because the library manager is probably handling dependencies on other libraries.

User avatar
ADAFroots
 
Posts: 10
Joined: Sat Sep 10, 2022 1:33 pm

Re: TLC59711 with Adafruit Library and example sketch (compile error)

Post by ADAFroots »

mikeysklar wrote: Wed Sep 28, 2022 5:07 pm Congrats. Glad you got it working and determined which library was necessary.

How had you been installing the libraries? Were you using the built-in library manager like my screen shot shows or did you manually install from github? I ask because the library manager is probably handling dependencies on other libraries.
Thanks!

I've always downloaded libraries separately and then installed them using the IDE software via -

"Sketch > Include Library > Add .ZIP Library..."

Whatever the component might be, I always read the product information on the manufacturer's page and in almost all cases the corresponding library has been available for direct download, so I use the one they suggest to make sure I'm not downloading another one by mistake.

It's possible the product page will instruct you to use the library manager like you suggested trying, but I've always gone with whatever the manufacturer suggests. In this case the Adafruit product page had a link to the library there for direct download.

I'm guessing the Adafruit_BusIO is required for a few different Adafruit components. So if someone already had it installed because they needed it for a another component, they wouldn't have ran into the problem I faced.

Are you saying, if I'd searched for and downloaded the TLC59711 library from the library manager in the IDE, it would have recognised if the Adafruit_BusIO was missing and prompted me to download that as well?

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: TLC59711 with Adafruit Library and example sketch (compile error)

Post by mikeysklar »

Yep. Use the Library Manager when possible. It will handle the dependencies as illustrated here:
Screenshot from 2022-10-01 10-22-36.png
Screenshot from 2022-10-01 10-22-36.png (53.63 KiB) Viewed 160 times

User avatar
ADAFroots
 
Posts: 10
Joined: Sat Sep 10, 2022 1:33 pm

Re: TLC59711 with Adafruit Library and example sketch (compile error)

Post by ADAFroots »

Good to know! I'll keep that in mind going forward, thanks for the help! :)

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”