"); //-->
#pragma sfr
#define uchar unsigned char
#define uint unsigned int
//-------------delay----------------
void delaynms(uint n)
{
uint i,j;
for(i=n;i>0;i--)
for(j=110;j>0;j--);
}
//--------------main-----------------
void main()
{
IMS = 0xc8;
IXS = 0x0c;
OSCCTL = 0X40;
PCC = 0x00; //Fcpu=Fxp
RCM = 0x83; //lsrstop,rstop
MOC = 0X00; //X1
MCM = 0X07;
for(;;)
{
uchar temp = 0x01;
uchar i;
PM6 = 0xf0;
P6 = 0xfe;
delaynms(500);
for(i = 3;i >0;i --)
{
temp <<= 1;
P6 = ~temp;
delaynms(500);
}
}
}
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。