流水燈左移指令循環(huán)程序 #include <reg52.h> #define uchar unsigned char uchar a,s,d; void main() { a=0xfe; while(1) { if(a!=0xff) { P1=a; a=a<<1; for(s=1000;s>0;s--) for(d=1000;d>0;d--); a=a+1; for(s=1000;s>0;s--) for(d=1000;d>0;d--); } else { a=0xfe; } } }
|