#include <STC15F2K60S2.H>
#include <intrins.H>
void Delay15us() //@12.000MHz
{
unsigned char i;
//delaytime xiao
_nop_();
_nop_();
i = 42;
while (--i);
}
unsigned char DuanMa[]={0xc0,0xf9,0xa4,0xb0};//gongyanji 0123
unsigned char WeiMa[]={0xF7,0xFB,0xFD,0xFE};
void main()
{
unsigned char i=0;
while(1)
{
P0=WeiMa[i ];
P2=DuanMa[ i];
Delay15us();
i++;
if(i==4)
{
i=0;
}
}
}
|