osimer pothe
osimer pothe

Reputation: 2897

how to print a string in 16*16 Dot Matrix from AVR

I want to output the string "LED GAME" as indicated in picture . But in Dot matrix , there are only 16 + 16 = 32 pins . is there any way to print a string from avr to dotmatrix ?

enter image description here

Upvotes: 0

Views: 1144

Answers (2)

osimer pothe
osimer pothe

Reputation: 2897

How can you identify Pin 1 Of Dot matrix ?

The leftmost pin of dot matrix on the opposite site of the label "2088BH-B" is pin 1 .

You can get a complete idea from the two following picture . enter image description here

enter image description here

Hope this will help you a lot . you can also try the following code which is written for showing 9 in dot matrix ( compiler: micro-C)

void main() 
{
     DDRB = 0b11111111;
     DDRC = 0b11111111;
     while(1)
     {
           PORTB=0b00000000;  // 1
           PORTC=0b10000000;
            Delay_us(5);

           PORTB=0b00000000;       //2
           PORTC=0b01000000;
            Delay_us(5);

           PORTB=0b00000000;          //3
           PORTC=0b00100000;
            Delay_us(5);

           PORTB=0b00000000;             //4
           PORTC=0b00010000;
            Delay_us(5);

           PORTB=0b10011110;  // 5
           PORTC=0b00001000;
            Delay_us(5);

           PORTB=0b10010010;       //6
           PORTC=0b00000100;
            Delay_us(5);

           PORTB=0b10010010;          //7
           PORTC=0b00000010;
           Delay_us(5);

           PORTB=0b11111110;             //8
           PORTC=0b00000001;
           Delay_us(5);

     }
}

Upvotes: 0

hbaderts
hbaderts

Reputation: 14326

Most LED matrixes are internally built up like this example here:

LED matrix

For a 16x16 LED matrix you thus have 16 pins for the rows and 16 pins for the columns. To see how your specific matrix is built up, you'll have to find its datasheet.

To write anything on the display, you will set the first row to ON, all others to OFF and activate the cols you need. After a delay, you will set the first row to OFF, the second row to ON and activate the cols you want to see in the second row. You will iterate through all rows like this. As the delay will be pretty short, your eyes aren't fast enough to see that the LEDs are off most of the time.

I would suggest to use a timer interrupt on you microcontroller and iterate through the rows in the interrupt routine. That way you can easily use the microcontroller for other things without worrying too much about timing issues.

Upvotes: 3

Related Questions