16*16点阵,为什么会显示乱码

每过1秒i+1,i用来消隐
每隔0.5秒k+1,0.5秒是一幅图像维持的时间,相当于滚动时间间隔0.5s

img

#include<reg51.h>
unsigned char i,j,k;
unsigned char string[]={
0x80,0x00, 0x80,0x00, 0x80,0x00, 0xFC,0x1F, 0x84,0x10, 0x84,0x10, 0x84,0x10, 0xFC,0x1F,
0x84,0x10,0x84,0x10,0x84,0x10,0xFC,0x1F,0x84,0x50,0x80,0x40,0x80,0x40,0x00,0x7F,

0x08,0x00,0x08,0x00,0xFC,0x3F,0x04,0x00,0xF2,0x0F,0x01,0x00,0xFC,0x0F,0x00,0x08,
0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x50,0x00,0x50,0x00,0x60,0x00,0x40,

0x10,0x00,0xF8,0x07,0x04,0x04,0xFE,0x1F,0x85,0x10,0x44,0x10,0xFC,0x1F,0x60,0x00,
0x98,0x08,0x46,0x05,0x30,0x03,0x8E,0x05,0x60,0x09,0x18,0x11,0x47,0x61,0x80,0x00,
};

void matrix()
{
inittimer();
            
            for(j=0;j<33;j++)
            {
            for(k=0;k<10;)
            {
                for(i=0;i<16;)
                {
                    P1=i;
                    P0=string[j*2+i*2];
                    P2=string[j*2+i*2+1];
                    i++;
                }
                k++;
            }
            }
}
void main()
{
    while(1)
    {
    matrix();
    }
}

void s() interrupt 1
{
unsigned char count;
TH0=0x3c;
TL0=0xB0;
if(count==20)i++;
if(count==10)k++;
}


i和k如果要作为标识,就不要在循环里也使用它
另,你的代码不全,s函数没有调用,而inittimer函数没有定义