#include
typedef unsigned int u16;
typedef unsigned char u8;
***it led=P2^0;
***it K1=P3^1;
void delay(u16 i)
{
while(i--);
}
void keypros()
{
if(K1==0)
{
delay(1000);
if(K1==0)
{
led=~led;
}
while(!K1);
}
}
void main()
{
while(1)
{
keypros();
}
}
#include
typedef unsigned int u16;
typedef unsigned char u8;
***it led=P2^0;
***it K1=P3^1;
void delay(u16 i)
{
while(i--);
}
void keypros()
{
if(K1==0)
{
delay(1000);
if(K1==0)
{
led=~led;
}
while(!K1);
}
}
void main()
{
while(1)
{
keypros();
}
}
举报