谢谢大家,可我还是搞不懂,显示出来的字看不懂.我的码是:
#include
#define uchar unsigned char
#define uint unsigned int
sbit e0=P1^4;//74hc154的E0口
uchar tt,ys;
uchar code templie[]={
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};//74hc的A0~A3码表
uchar code hanzi[]={
0x00,0x00,0x3F,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,0x10,0x3F,0x10,0x00,0x00,
0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0xFF,0x40,0x40,0x40,0x40,0xE0,0x00,0x00,0x00};//中
void delay(uint z)
{
uint x,y;
for (x=110;x>0;x--)
for(y=z;y>0;y--);
}
void main()
{
uchar i;
e0=0;
tt=0;
ys=0;
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
while(1)
{
for(i=0;i <8;i++)
{
P0 = hanzi;
P2 = hanzi[i+1];
if(tt==16)
{
tt=0;
P1=templie[ys];
ys++;
}
}
}
}
void exter0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tt++;
} |