8x8 Led matrix 16pin better way of achieving my result

Hello,
i am completely new to all of this.
I have a lot of teensy, esp8266 and arduino boards at home but never really played with them that much just turned 1 LED on and off and that was basically it.

I was in some local store and i got 8x8 LED matrix for free and wanted to play around with it. I made it work, but process was tedious and i am sure there are better ways of achieving the same…

I put LED matrix in breadboard and connected all 16 pins to teensy then wrote the code to display my name letter by letter. Basically i wrote one loop for every letter and then run every loop a 100 times before going to the next loop or letter.

Do you have any suggestion to tackle this problem with different method to “expand my horizon” ? :slight_smile:

Thank you

Here is displayed part of my code just for quick preview and i attached .ino file with full code

int column1 = 1;
int column2 = 2;
int column3 = 3;
int column4 = 4;
int column5 = 5;
int column6 = 6;
int column7 = 7;
int column8 = 8;
int row1 = 10;
int row2 = 11;
int row3 = 12;
int row4 = 13;
int row5 = 14;
int row6 = 15;
int row7 = 16;
int row8 = 17;

void setup() {
  pinMode(column1, OUTPUT);
  pinMode(column2, OUTPUT);
  pinMode(column3, OUTPUT);
  pinMode(column4, OUTPUT);
  pinMode(column5, OUTPUT);
  pinMode(column6, OUTPUT);
  pinMode(column7, OUTPUT);
  pinMode(column8, OUTPUT);
  pinMode(row1, OUTPUT);
  pinMode(row2, OUTPUT);
  pinMode(row3, OUTPUT);
  pinMode(row4, OUTPUT);
  pinMode(row5, OUTPUT);
  pinMode(row6, OUTPUT);
  pinMode(row7, OUTPUT);
  pinMode(row8, OUTPUT);
}

void loopG(void) {
  int var = 0;
  while(var < 100){
   /*
   * TurnOFFALL
   */
  digitalWrite(row1, LOW);
  digitalWrite(row2, LOW);
  digitalWrite(row3, LOW);
  digitalWrite(row4, LOW);
  digitalWrite(row5, LOW);
  digitalWrite(row6, LOW);
  digitalWrite(row7, LOW);
  digitalWrite(row8, LOW);
  digitalWrite(column1, HIGH);
  digitalWrite(column2, HIGH);
  digitalWrite(column3, HIGH);
  digitalWrite(column4, HIGH);
  digitalWrite(column5, HIGH);
  digitalWrite(column6, HIGH);
  digitalWrite(column7, HIGH);
  digitalWrite(column8, HIGH);
  /*
   * Letter G
   */
  digitalWrite(column3, LOW);
  digitalWrite(column4, LOW);
  digitalWrite(column5, LOW);
  digitalWrite(column6, LOW);
  digitalWrite(row1, HIGH);
  delay(1);
  digitalWrite(column3, HIGH);
  digitalWrite(column4, HIGH);
  digitalWrite(column5, HIGH);
  digitalWrite(column6, HIGH);
  digitalWrite(row1, LOW);
  delay(1);
  digitalWrite(column2, LOW);
  digitalWrite(column3, LOW);
  digitalWrite(column6, LOW);
  digitalWrite(column7, LOW);
  digitalWrite(row2, HIGH);
  delay(1);
  digitalWrite(column2, HIGH);
  digitalWrite(column3, HIGH);
  digitalWrite(column6, HIGH);
  digitalWrite(column7, HIGH);
  digitalWrite(row2, LOW);
  delay(1);
  digitalWrite(column2, LOW);
  digitalWrite(column3, LOW);
  digitalWrite(row3, HIGH);
  delay(1);
  digitalWrite(column2, HIGH);
  digitalWrite(column3, HIGH);
  digitalWrite(row3, LOW);
  delay(1);
  digitalWrite(column2, LOW);
  digitalWrite(column3, LOW);
  digitalWrite(row4, HIGH);
  delay(1);
  digitalWrite(column2, HIGH);
  digitalWrite(column3, HIGH);
  digitalWrite(row4, LOW);
  delay(1);
  digitalWrite(column2, LOW);
  digitalWrite(column3, LOW);
  digitalWrite(row5, HIGH);
  delay(1);
  digitalWrite(column2, HIGH);
  digitalWrite(column3, HIGH);
  digitalWrite(row5, LOW);
  delay(1);
  digitalWrite(column2, LOW);
  digitalWrite(column3, LOW);
  digitalWrite(column5, LOW);
  digitalWrite(column6, LOW);
  digitalWrite(column7, LOW);
  digitalWrite(row6, HIGH);
  delay(1);
  digitalWrite(column2, HIGH);
  digitalWrite(column3, HIGH);
  digitalWrite(column5, HIGH);
  digitalWrite(column6, HIGH);
  digitalWrite(column7, HIGH);
  digitalWrite(row6, LOW);
  delay(1);
  digitalWrite(column2, LOW);
  digitalWrite(column3, LOW);
  digitalWrite(column6, LOW);
  digitalWrite(column7, LOW);
  digitalWrite(row7, HIGH);
  delay(1);
  digitalWrite(column2, HIGH);
  digitalWrite(column3, HIGH);
  digitalWrite(column6, HIGH);
  digitalWrite(column7, HIGH);
  digitalWrite(row7, LOW);
  delay(1);
  digitalWrite(column3, LOW);
  digitalWrite(column4, LOW);
  digitalWrite(column5, LOW);
  digitalWrite(column6, LOW);
  digitalWrite(row8, HIGH);
  delay(1);
  digitalWrite(column3, HIGH);
  digitalWrite(column4, HIGH);
  digitalWrite(column5, HIGH);
  digitalWrite(column6, HIGH);
  digitalWrite(row8, LOW);
  delay(1);
  var++;
  }
}

...
...
...
...
...

void loop(void) {
  loopG();
  loopR();
  loopE();
  loopG();
  loopO();
  loopR();
  loopDelay();
  loopS();
  loopA();
  loopL();
  loopA();
  loopM();
  loopU();
  loopN();
  loopDelay();
}

Teendy20__LEDMatrix16pinNameDisplay.ino (32.1 KB)

Board is Teensy 2.0 ++
and i could not post the full code since there is 9000 character limitation.

Thank you

Somewhat of a waste of time really! Get a MAX7219 module.

The sensible way to approach this is to buy a couple (and why not?) of the rubbish MAX7219 matrix modules - as a kit.

This gives you ridiculous available brightness (but totally controllable both as the maximum which is set by the single resistor and overall in steps by code) requiring no code to continuously multiplex the display; you only update the MAX7219s when you want to change the display and the interface is simple using SPI or shiftOut.


So why did I call the modules "rubbish"? Because using these modules with the original matrix displays makes them entirely impractical to stack which is what most people want to do - if you wish to do this you would use the proper design instead. :grinning:

In fact, if you were actually creating a serious display such as for a game, you might even consider upgrading to a more sophisticated but relatively inexpensive display using MAX7219 (stackable further) modules:

Not somewhat waste of time... It definitely was waste of time but learned a lot though :slight_smile: Still proud of my achievement...

Thank you for your reply. Will order some and test them out.

Do you recommend for me to get a arduino or can i stick with teensy 2.0 ++ ?

You can try out timer based interrupts to drive your display.