缘由一个独立按键控制流水灯开关-编程语言-CSDN问答
#include<reg52.h>//头文件
sbit k1=P3^7;//
void main() //主函数
{unsigned char sj=0, ls=0;unsigned int ys=0;P0=0;/*P0=255;*/while(1){if(!k1&&!++sj){if(!ls){ls=1;/*P0=0;*/}else ls=0;while(!k1);}if(!++ys){if(ls)P0<<=1;else P0=0;/*P0=255;*/if(/*ls&&*/P0==0)P0=1;}}
}
随手写的状态控制梨子想怎么玩就怎么玩