Arduino Code for chained 8x8 LED displays

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
MegaByteMaster
 
Posts: 4
Joined: Fri Feb 21, 2014 8:13 pm

Arduino Code for chained 8x8 LED displays

Post by MegaByteMaster »

I use 3 bicolor 8x8 LED displays in a little arduino project and want to use them as one 8x24 display. Thanks to the great documentation and sample code I managed to control them separately. What I then tried is to write a class that internally manages the three displays and exposes the print and drawBitmap (also setCursor, ...) functions. It should work like this:

Code: Select all

Adafruit_ChainedMatrix matrix = Adafruit_ChainedMatrix();

matrix.init(0x70, 0x71, 0x72);
matrix.setRotation(3);

matrix.print("long text");
matrix.writeDisplay();
But I couldn't manage the display handling. Did somebody already try something similar and has some code to share? Maybe this would be a great extension to the sample code.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Arduino Code for chained 8x8 LED displays

Post by adafruit_support_mike »

Take a look at this tutorial and see if it helps: http://learn.adafruit.com/animating-mul ... -backpacks

MegaByteMaster
 
Posts: 4
Joined: Fri Feb 21, 2014 8:13 pm

Re: Arduino Code for chained 8x8 LED displays

Post by MegaByteMaster »

Thanks for the hint, but unfortunately I'm still stuck here. I looked at the sample project which seemed to be promising, but the essential parts including the full sources are missing. It would be interesting how the large array is drawn to the three displays. But I don't even come that far as the suggested way of initializing multiple displays doesn't work for me. I reduced the code to this not compiling minimal example:

Code: Select all

#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"

Adafruit_BicolorMatrix matrix[3];

void setup() {
  Serial.begin(9600);
  
  for(uint8_t i=0; i<3; i++) {
      matrix[i] = Adafruit_BicolorMatrix();
      matrix[i].begin(0x70 + i);
  }
}

void loop()
{  
  delay(200);
}
The complete error message is:
/Users/MegaByteMaster/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h: In member function 'Adafruit_GFX& Adafruit_GFX::operator=(const Adafruit_GFX&)':
/Users/MegaByteMaster/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:13: error: non-static const member 'const int16_t Adafruit_GFX::WIDTH', can't use default assignment operator
/Users/MegaByteMaster/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:13: error: non-static const member 'const int16_t Adafruit_GFX::HEIGHT', can't use default assignment operator
/Users/MegaByteMaster/Documents/Arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.h: In member function 'Adafruit_BicolorMatrix& Adafruit_BicolorMatrix::operator=(const Adafruit_BicolorMatrix&)':
/Users/MegaByteMaster/Documents/Arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.h:91: note: synthesized method 'Adafruit_GFX& Adafruit_GFX::operator=(const Adafruit_GFX&)' first required here
ChainedDisplayTest.ino: In function 'void setup()':
ChainedDisplayTest.ino.ino:32: note: synthesized method 'Adafruit_BicolorMatrix& Adafruit_BicolorMatrix::operator=(const Adafruit_BicolorMatrix&)' first required here
I double checked the "installation" of the libraries and tested my previous sample code which is still running fine.

I also don't think that the sample project will solve my problem printing text over all three displays. The image code is kind of simple, just drawing three independent bitmaps to the corresponding displays, but with text where one single character could be partially on two different displays that would not work.

Any other suggestions?

User avatar
cameraready
 
Posts: 55
Joined: Wed Jan 30, 2013 11:10 pm

Re: Arduino Code for chained 8x8 LED displays

Post by cameraready »

http://forums.adafruit.com/viewtopic.php?f=52&t=47519

I was able to get some matrices working with a trinket. I posted the code in the trinket forum. The only change would be switching the tinywire library back to the wire library I think.

MegaByteMaster
 
Posts: 4
Joined: Fri Feb 21, 2014 8:13 pm

Re: Arduino Code for chained 8x8 LED displays

Post by MegaByteMaster »

@cameraready:

Thanks a lot. That was the hint I needed.

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

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”