#include "reg52.h"
#include "intrins.h"
typedef unsigned int u16;
#define uint unsigned int
#define uchar unsigned char
void delayms(uint);
uchar aa;
sbit k1=P3^1;
void delay(u16 i)
{
while(i--);
}
void keypros()
{
if(k1==0)
{
delay(10);
if(k1==0)
{
aa=0xfe;
while(1)
{
P1=aa;
delayms(500);
aa=_crol_(aa,1);
}
}
while(!k1);
}
}
void delayms(uint xms)
{
uint i,j;
for(i=xms;i>0;i--)
for(j=110;j>0;j--);
}
|