#include<reg52.h>
#include"hl52_h.c"
#define uchar unsigned char
uchar code duma[6]={ 0X6,0X5B,0X4F,0X66,0X6D,0X7D} ;
uchar code weima[6]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf};
void delay(float t)
{
unsigned int k,j;
j=t*100 ;
while(j-->0)
{
for(k=200;k>0; k--) ;
}
}
void main ()
{
int i=0;
while(1)
{
DU=1;
P0=duma[i];
DU=0;
WEI=1;
P0=weima[i];
WEI=0;
delay(9);
i=i++;
//if(i=5)
// {
// i=1;
// }
DU=1;
P0=0X76; //显示H
DU=0;
WEI=1;
P0=0X0;
WEI=0;
delay(8);
}
}
|