Go Down

Topic: 8x8 Led matrix programing issue? (Read 1 time) previous topic - next topic

AWOL

Quote
I changed it to 'byte'.

So down from a 16x overhead to only an 8x overhead.
Keep going.

Quote
What can I use instead of delay() ?

Have a look at the blink without delay example, provided with the IDE.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

szaboa1

I don't know how to use that example for my 8x8 led matrix..yet. Turn on an led, wait, turn off that led, wait, turn the next led...something like this?
Without delay, the brightness will be ok?:)

szaboa1


michinyon

So to do your 64 outputs,  with half a second delay for each one,  will take 32 second per cycle.
That's never going to work.

If I was going to drive leds that way,  I'd try something like this

Code: [Select]

int n_on ;
int ons[8] ;
for ( int k=0 ; k<8 ; k++ )
{
    ons[k]=0 ;
}

for ( int j=0 ; j<8 ; j++ )
{
    for ( int i=0 ; i<8 ; i++ )
    {
        if ( pattern[i][j] )
        {
            ons[n_on]=i ;
            n_on++ ;
            digitalWrite( row[i], HIGH );
        }
    }
    if ( n_on > 0 )
    {
        digitalWrite( col[j], LOW );
        delay(15) ;
        digitalWrite( col[j], HIGH );
        for ( int m=0 ; m<n_on ; m++ )
        {
            digitalWrite( row[ons[m]], LOW );
        }
        n_on=0 ;
    }
}


szaboa1

The code is working, I can see the pattern but the brightness is low again..how can I fix the brightness problem? With 'delay(150)' the brightness is ok.. :~

Go Up