0
#include "at89x51.h"
#include "intrins.h"
#define uint unsigned int
#define uchar unsigned char
code uchar tab1[]={0x84,0x00,0x44,0x80,0x24,0x88,0x14,0x84,0xFF,0x42,0x94,0x47,0x24,0x49,0x44,0x31,
0x24,0x11,0x14,0x09,0xFF,0x05,0x14,0x03,0x24,0x01,0x66,0x00,0x24,0x00,0x00,0x00,0x00,0x21,0x08,0x21,
0x28,0x11,0x48,0x11,0xC8,0x09,0x08,0x05,0x08,0x03,0xFF,0xFF,0x08,0x03,0x88,0x05,0x48,0x09,0x68,0x19,
0x0C,0x11,0x88,0x31,0x00,0x11,0x00,0x00,0x00,0x00,0xF8,0x7F,0x0C,0x21,0x0B,0x21,0x08,0x21,0x08,0x21,
0xFC,0x7F,0x28,0x00,0x90,0x00,0x0F,0x01,0x08,0x43,0x08,0x80,0x08,0x40,0xFC,0x3F,0x08,0x00,0x00,0x00,
0x22,0x44,0x14,0x82,0x08,0x41,0xF4,0x3F,0x02,0x40,0x20,0x40,0x22,0x7E,0xA2,0x42,0x22,0x7F,0xFA,0x42,
0x2A,0x7E,0x26,0x42,0x32,0x7F,0x20,0x42,0x00,0x40,0x00,0x00};
const uchar tab2[]={0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef};
const uchar tab3[]={0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf};
const uchar tab4[]={0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf};
const uchar tab5[]={0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f};
void delay(uint n)
{ uint i;
for(i=0;i
}
void main()
{
uchar j=0,q=0,y=0;
uchar r,t=0;
while(1)
{
for(j=q;j
{
if(y==0)
{P2=tab2[t];
P0=tab1[j];
j++;
P1=tab1[j];
}
else if(y==1)
{P2=tab3[t];
P0=tab1[j];
j++;
P1=tab1[j];}
else if(y==2)
{P2=tab4[t];
P0=tab1[j];
j++;
P1=tab1[j];}
else
{P2=tab5[t];
P0=tab1[j];
j++;
P1=tab1[j];}
delay(90);
t++;
if(t==16)
t=0;
}
y++;
if(y==4)
y=0;
q=q+32;
if(q==128)
q=0;
}
}
程序如上,为什么显示不够快?看的出闪烁?
|
|