|
#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar code DSY_CODE[]={0x90,0x80,0xf8,0x82,0x92,0x99,0xb0,0xa4,0xf9,0xc0,0xFF};
void DelayMS(uint x)
{
uchar t;
while(x--) for(t=0;t<120;t++);
}
void main()
{
uchar i=0;
P2=0x00;
while(1)
{
P2=~DSY_CODE[i];
i=(i+1)%10;
DelayMS(180);
}
}
|
評分
-
查看全部評分
|