|
#include <REGX52.H>
#include <INTRINS.H>
#define uchar unsigned char
#define uint unsigned int
uchar code DSY_CODE[]= //DSY_CODE
{
0xC0,0xF9,0xA4,0xB0,0x99,0x82,0xF8,0x80,0xFC
};
void DelayMS(uint x)
{
uchar t;
while(x--)
for(t=120;t>0;t--); // t--
}
void main()
{
uchar i=0;
P0=0x00;
while(1)
{
P0=~DSY_CODE[i];
i=(i+1)%10;
DelayMS(200);
}
} |
|