Noob help with 8x8 led matrix

Hiya can anyone give me an example of some code for the 8x8 led things you get with the arduino starter pack? And could you also point me in the right direction of learning how to programme the LEDs? Thanks in advance

Just ask google, if you don't find go back here :slight_smile:

Have you checked out the learning page on this site? It was pretty helpful for me, just getting an idea of the basics and I think that they have some the examples you are looking for...

also, Arduino Tutorial - Learn electronics and microcontrollers using Arduino!

Don't know. Pretty green on this stuff myself but I went to those sites just to figure out the basics.

Thanks for the reply, It seems they only have tutorials for the led displays with the "backpacks" which are the adapter things, so not really much use to me. Can anyone give me some code for an example? Perhaps I can get the basic idea then.

This will give you the basic idea of the two ways to multiplex a matrix.

http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html

I’m trying to make the 8x8 led matrix board work with my arduino uno, but when I do the exact same code and pin layout as the one on the website, nothing happens. It’s not the matrix board because I have already tried 2. Pretty sure it’s not the uno either as it works for everything else. Any ideas or am I just going to have to abandon my project im doing? Thanks for reading

It would be easier to help you with your code if you were to provide the code that is giving you problems. There are a shipload of web sites dealing with 8x8 matrix so a link would help.

groundfungus:
It would be easier to help you with your code if you were to provide the code that is giving you problems. There are a shipload of web sites dealing with 8x8 matrix so a link would help.

Thanks for your reply, sorry I forgot to mention it was the layout and code from the arduino website.
Here’s the code

 /*
  Row-Column Scanning an 8x8 LED matrix with X-Y input
 
 This example controls an 8x8 LED matrix using two analog inputs
 
 created 27 May 2009
 modified 30 Aug 2011
 by Tom Igoe
 
 This example works for the Lumex  LDM-24488NI Matrix. See 
 http://sigma.octopart.com/140413/datasheet/Lumex-LDM-24488NI.pdf
 for the pin connections
 
 For other LED cathode column matrixes, you should only need to change 
 the pin numbers in the row[] and column[] arrays
 
 rows are the anodes
 cols are the cathodes
 ---------
 
 Pin numbers:
 Matrix:
 * Digital pins 2 through 13,
 * analog pins 2 through 5 used as digital 16 through 19
 Potentiometers:
 * center pins are attached to analog pins 0 and 1, respectively
 * side pins attached to +5V and ground, respectively.
 
 This example code is in the public domain.
 
 http://www.arduino.cc/en/Tutorial/RowColumnScanning
 
 see also http://www.tigoe.net/pcomp/code/category/arduinowiring/514 for more
 */


// 2-dimensional array of row pin numbers:
const int row[8] = {
  2,7,19,5,13,18,12,16 };

// 2-dimensional array of column pin numbers:
const int col[8] = {
  6,11,10,3,17,4,8,9  };

// 2-dimensional array of pixels:
int pixels[8][8];           

// cursor position:
int x = 5;
int y = 5;

void setup() {
  // initialize the I/O pins as outputs
  // iterate over the pins:
  for (int thisPin = 0; thisPin < 8; thisPin++) {
    // initialize the output pins:
    pinMode(col[thisPin], OUTPUT); 
    pinMode(row[thisPin], OUTPUT);  
    // take the col pins (i.e. the cathodes) high to ensure that
    // the LEDS are off: 
    digitalWrite(col[thisPin], HIGH);    
  }

  // initialize the pixel matrix:
  for (int x = 0; x < 8; x++) {
    for (int y = 0; y < 8; y++) {
      pixels[x][y] = HIGH;
    }
  }
}

void loop() {
  // read input:
  readSensors();

  // draw the screen:
  refreshScreen();
}

void readSensors() {
  // turn off the last position:
  pixels[x][y] = HIGH;
  // read the sensors for X and Y values:
  x = 7 - map(analogRead(A0), 0, 1023, 0, 7);
  y = map(analogRead(A1), 0, 1023, 0, 7);
  // set the new pixel position low so that the LED will turn on
  // in the next screen refresh:
  pixels[x][y] = LOW;

}

void refreshScreen() {
  // iterate over the rows (anodes):
  for (int thisRow = 0; thisRow < 8; thisRow++) {
    // take the row pin (anode) high:
    digitalWrite(row[thisRow], HIGH);
    // iterate over the cols (cathodes):
    for (int thisCol = 0; thisCol < 8; thisCol++) {
      // get the state of the current pixel;
      int thisPixel = pixels[thisRow][thisCol];
      // when the row is HIGH and the col is LOW,
      // the LED where they meet turns on:
      digitalWrite(col[thisCol], thisPixel);
      // turn the pixel off:
      if (thisPixel == LOW) {
        digitalWrite(col[thisCol], HIGH);
      }
    }
    // take the row pin low to turn off the whole row:
    digitalWrite(row[thisRow], LOW);
  }
}

So you have the Lumex LDM-24488NI Matrix?

oOhttpOo:
I’m trying to make the 8x8 led matrix board work with my arduino uno, but when I do the exact same code and pin layout as the one on the website, nothing happens. It’s not the matrix board because I have already tried 2. Pretty sure it’s not the uno either as it works for everything else. Any ideas or am I just going to have to abandon my project im doing? Thanks for reading

i have did this project 6 month ago, you must check your 8x8 led matrix rows and column because every type of 8x8 led matrix has different rows and column pin…Check your 8x8 led matrix pin using ohm meter write down the column and row pin then declare your matrix pin in program…

ichbal_seb:
Check your 8x8 led matrix pin using ohm meter write down the column and row pin then declare your matrix pin in program..

Could be quicker - explain what matrix board you actually have - where is the Web link to it so that the datasheet can be found? Or is it in fact, the one cited in the code in which case what "board" do you mean?

And where is the perfectly focused and properly lit photograph of your setup as always required when you post a question?

Hi
I am having trouble working out how these 8x8 led matrix displays work, I have spent a lot of time in the tutorials, the matrix example, but I don't understand the code. I figured out how to control a row, but I don't get how you control multiple LEDs in a row/column. Can someone give me a link to an easy, understandable tutorial?

Edit: I am trying to make an 'eye', if that helps.

Hi
I am having trouble working out how these 8x8 led matrix displays work, I have spent a lot of time in the tutorials, the matrix example, but I don’t understand the code. I figured out how to control a row, but I don’t get how you control multiple LEDs in a row/column. Can someone give me a link to an easy, understandable tutorial?

does it have a controller or is it just the matrix?

how these 8x8 led matrix

You can see "these", but we can't

AWOL:
You can see “these”, but we can’t

I don’t understand what you’re asking me or how this helps me.

You’re asking about some (to us unknown) form of LED matrix.
Don’t you think we might need some details to help us help you?

Ok sorry for not being clear, I am trying use an 38mm 8x8 led dot display board (present in the arduino starter kit I believe). However I think I am starting to get the hang of it now after a bit more practise, although any links would still be nice.

They're asking specifically what hardware you're using, how you're connecting it and what software and libraries you're using.

I've had a bit of a play with generic 8x8 monochrome LEDs driven with a MAX7219 chip. I made a pair of blinking eyes using cheapo Chinese matrix modules with MAX7219 from ebay. I also made a LED matrix clock with 3 off such 8x8 matrices.

The main problem with these particular ones I'm using is that they don't start responding to data input reliably at power on, so they need powering on and off several times until they get into the right state. Dunno why.

(I see you sort-of answered this but they want more detail)

sickparrot:
The main problem with these particular ones I'm using is that they don't start responding to data input reliably at power on, so they need powering on and off several times until they get into the right state. Dunno why.

You need a pull-up resistor - say 4k7 - on the Chip Select line.

Have a think about it and you will figure out why.