[PIC] 2d array vertical scroll help

Status
Not open for further replies.

anoopmb24

Junior Member level 1
Joined
Oct 24, 2010
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Visit site
Activity points
1,410
hi,
I have created a 32x7 led matrix using pic 18f2550 running at 48mhz(20mhz crystal)
seven rows are scanned with cd4017 johnson counter
32 columns are driven by four 74hc595 shift registers

scanning is done with a buffer array[7][32] in timer0 overflow interupt at an in interval of 1.8 microseconds
i made it to x-y addressable with the following code
also i can display characters
Code:
unsigned short cols[7][32] = {
                              {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
                              {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
                              {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
                              {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
                              {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
                              {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
                              {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
                              };

void setpixel(char x, char y, short onc)
{
if(onc==1)cols[y][x]=1 ;else cols[y][x]=0;

}


// function to test a bit if its 1 or 0
char TestBit(unsigned char x, short i) {
 return ((x >> i) & 1);
}

void scroll_up_letter(char lett,char step,char speed) {
  char ch;
  short temp[7][32]  ;
 short i;
 short x;
ch=lett-32,
 for(i=0;i<7;i++)
 {
 vdelay_ms(speed);
    for(x=0;x<5;x++) {
   
  if(Testbit(font_table[ch][i],x))
        cols[i][x] =1;

    }
     cols[i][x]=cols[i+1][x];
    cols[6][x]=0;
 }

 
 
}



but its not working how can i circularly shift 2 dimensional array

please help me thanks in advance
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…