|
#include<reg52.h>
typedef unsigned int u16;
typedef unsigned char u8;
void delay(u16 i)
{
while(i--);
}
u8 j;
u8 code HENG[8]={0xe7,0xe7,0x81,0xa5,0x81,0xe7,0xe7,0xe7};
void main()
{
P2=0x80;
P0=0Xff;
while(1)
{
for(j=0;j<8;j++)
{
P2=(0x80>>j);
P0=HENG[j];
delay(250);
}
}
}
|
|