Problem compiling example 8x8 LED matrix backpack sketch

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.
User avatar
argregga
 
Posts: 4
Joined: Thu Sep 20, 2012 9:19 pm

Problem compiling example 8x8 LED matrix backpack sketch

Post by argregga »

Hello,

I am trying to compile the example sketch for the Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Red.

I have downloaded the example and library from GIT. I renamed the directory to Adafruit_LEDBackpack. It shows up in the Arduino IDE as expected.

I also downloaded the Adafruit GFX library and renamed the directory Adafruit_GFX as instructed.

However, when I try to compile the sketch, I get the following errors:

Code: Select all

/home/greg/Arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp: In constructor ‘Adafruit_8x8matrix::Adafruit_8x8matrix()’:
/home/greg/Arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:92: error: no matching function for call to ‘Adafruit_GFX::Adafruit_GFX()’
/home/greg/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:17: note: candidates are: Adafruit_GFX::Adafruit_GFX(int16_t, int16_t)
/home/greg/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:13: note:                 Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&)
/home/greg/Arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:93: error: ‘constructor’ was not declared in this scope
/home/greg/Arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp: In constructor ‘Adafruit_BicolorMatrix::Adafruit_BicolorMatrix()’:
/home/greg/Arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:129: error: no matching function for call to ‘Adafruit_GFX::Adafruit_GFX()’
/home/greg/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:17: note: candidates are: Adafruit_GFX::Adafruit_GFX(int16_t, int16_t)
/home/greg/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:13: note:                 Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&)
/home/greg/Arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:130: error: ‘constructor’ was not declared in this scope
As I am not a skilled programmer, I am having trouble understanding how I should proceed. I have looked at the libraries and it seems that the function "Adafruit_GFX::Adafruit_GFX" does exist, so I don't know what the problem is.

I am excited to get this Adafruit product working, so I hope someone can tell me where I went wrong, or what I should try next.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by adafruit_support_rick »

Hi - Looks like you happened to pick a bad time to download the library. There was some maintenance work done on the Adafruit_GFX library within the past day, and that seems to have broken the 8x8 matrix library.

I'll look into it. Thanks for your patience…

Meanwhile, I've attached an older version of Adafruit_GFX - see if that helps...
Attachments
Adafruit_GFX.zip
(9.69 KiB) Downloaded 410 times

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by pburgess »

Please download the latest LED backpack library from Github:
https://github.com/adafruit/Adafruit-LE ... ck-Library

Your timing was fine. I screwed this one up! Made a fix to Adafruit_GFX that required updating all of the subclass libraries. Friday morning was a mad dash to get them all updated to prevent exactly this from happening, and of course I missed one. Very sorry about that! All should be good now.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by adafruit_support_rick »

Thanks, Phil!

User avatar
argregga
 
Posts: 4
Joined: Thu Sep 20, 2012 9:19 pm

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by argregga »

Thanks, I downloaded it again and it works great!

User avatar
normlane
 
Posts: 128
Joined: Thu Apr 01, 2010 5:39 pm

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by normlane »

I'm having the same trouble only with the bi-color matrix and I just downloaded it.


C:\arduino\libraries\Adafruit_LED_Backpack_Library_master\Adafruit_LEDBackpack.cpp: In constructor 'Adafruit_8x8matrix::Adafruit_8x8matrix()':
C:\arduino\libraries\Adafruit_LED_Backpack_Library_master\Adafruit_LEDBackpack.cpp:92: error: no matching function for call to 'Adafruit_GFX::Adafruit_GFX(int, int)'

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by pburgess »

Be sure to update both libraries -- Adafruit_GFX and Adafruit_LEDBackpack.

User avatar
normlane
 
Posts: 128
Joined: Thu Apr 01, 2010 5:39 pm

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by normlane »

I did.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by adafruit_support_rick »

NormLane wrote:I did.
And you still get the error? Make sure you don't have multiple copies of either library. Check in the Arduino application folder - you may have put an older version of one of the libraries in there at some point. User libraries should always go in the sketchbook "libraries" folder, not in the Arduino libraries folder.

User avatar
normlane
 
Posts: 128
Joined: Thu Apr 01, 2010 5:39 pm

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by normlane »

I deleted the library and re-installed. Everything is working now.
Thanks

VanChriz
 
Posts: 1
Joined: Tue Aug 20, 2013 1:56 pm

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by VanChriz »

Ahoy,
I just recieved and assembled my 1.2" 8x8 Red Matrix with I2C backpack and wanted to try it out using the example 8x8 sketch, resulting in a failure. I tried every suggested solution in this thread and reinstalled both the libraries as well as my Arduino environment. The shown error message reads
Line 26: (original line: Adafruit_8x8matrix matrix = Adafruit_8x8matrix();)
"'Adafruit_8x8matrix' does not name a type."

And then I get these, which are pretty self-explanatory, but I still couldn't fix them:
matrix8x8.ino:23:34: error: Adafruit_LEDBackpack.h: No such file or directory
matrix8x8:26: error: 'Adafruit_8x8matrix' does not name a type
I think these two are the big deal.
matrix8x8.ino: In function 'void setup()':
matrix8x8:32: error: 'matrix' was not declared in this scope
matrix8x8.ino: In function 'void loop()':
matrix8x8:65: error: 'matrix' was not declared in this scope
matrix8x8:66: error: 'LED_ON' was not declared in this scope

I also tried abandoning my old Sketch folder, made a new one somewhere else and tried it again. Didn't work.
Since, after renaming the unzipped github folder, the folder in the folder still has the original github name, I tried renaming this one as well. Neither did this work.

Does someone have a clue where the mistake can be found?
Cheers, Chris.

Edit, the morning after: I just had to move it one folder upwards for the environment to find it, silly me.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by adafruit_support_rick »

VanChriz wrote:Edit, the morning after: I just had to move it one folder upwards for the environment to find it
Anyone else having this problem, please check out our tutorial on Arduino Libraries:
http://learn.adafruit.com/adafruit-all- ... nstall-use

User avatar
robot724
 
Posts: 4
Joined: Tue May 24, 2011 7:24 pm

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by robot724 »


Hello
I have come across this problem myself when attempting to compile the example sketch for the NeoPixel stick I was testing. I had already installed the Adafruit_GFX library from my work on the 8x8 matrix back in January so I did not update that. To get the NeoPixel to work I did have to update the GFX library. But yesterday I attempted to get my 8x8 matrix to work again. It was working with the GFX library I had from before. I started getting the compile error for the matrix example just like for the NeoPixel strip. In fact several sketchs that had run in the past got the compile error also. To solve this I went back to my backup from January and loaded an older version of the GFX library which solved the matrix compile problem. I have created two directories, not in Arduino path, called Adafruit_GFX(old and new). The only way I could identify which Adafruit_GFX.h worked with what was the file size. Adafruit_GFX.h (4k) works with the 8x8 matrix, and the Adafruit_GFX.h (3k) works with the NeoPixel. I have not compared the files to see differences as yet. I present this as information to help solve this problem, although you have probably already noticed this quirk with the GFX libraries. Thanks Brad.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by adafruit_support_rick »

Brad - You should not have this problem at all. There were some changes to Adafruit_GFX a couple of months ago, but to my knowledge, all of the dependent libraries have been updated. I will look into this.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Problem compiling example 8x8 LED matrix backpack sketch

Post by pburgess »

The NeoPixel library isn't dependent on Adafruit_GFX, but NeoMatrix is. Maybe you were trying to use that? But yes, all the dependent libraries needed small changes along with the Adafruit_GFX change. When in doubt, update the lot.

Adafruit_GFX
Adafruit_LEDBackpack
Adafruit_NeoPixel
Adafruit_NeoMatrix

Make certain these all go in your documents/sketchbook/libraries folder, NOT the libraries folder that's alongside the Arduino application. If any of these are installed in there, delete them.

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

Return to “Arduino”