标题: [原创]P0口8位流水灯程序 [打印本页]

作者: xlndz    时间: 2012-1-28 18:09
标题: [原创]P0口8位流水灯程序

#include<stc90.h>
void delay(unsigned int s){
    while(s--);
}
void main(void){
unsigned char a;
a=0xFE;
 while(1){
 P0=a;
 delay(60000);
 a=a << 1;
 a=a|0x01;
 if(a==0xFF) a=0xFE;
 }

}


作者: xlndz    时间: 2012-2-2 15:34






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1