#include
typedef unsigned char uint8;
typedef unsigned int uint16;
sbit anjian = P1^0; //按鍵位
void delay(uint16 h) //延時程式
{
while(h--);
}
main()
{ uint8 k = 0 , i = 0;
P0 = 0xff;
anjian = 1;
while(1)
P0 = ~(1
if(anjian == 0)
delay(200);
if(anjina == 0) i++;
if(i == 3)
i = 0;
switch(i)
case 0: delay(10000);break;
case 1: delay(20000);break;
case 2: delay(20000); break;
if(k==8) k=0;
#include
typedef unsigned char uint8;
typedef unsigned int uint16;
sbit anjian = P1^0; //按鍵位
void delay(uint16 h) //延時程式
{
while(h--);
}
main()
{ uint8 k = 0 , i = 0;
P0 = 0xff;
anjian = 1;
while(1)
{
P0 = ~(1
if(anjian == 0)
{
delay(200);
if(anjina == 0) i++;
if(i == 3)
i = 0;
}
switch(i)
{
case 0: delay(10000);break;
case 1: delay(20000);break;
case 2: delay(20000); break;
}
if(k==8) k=0;
}
}