標題: [原創(chuàng)]P0口8位流水燈程序 [打印本頁]

作者: xlndz    時間: 2012-1-28 18:09
標題: [原創(chuàng)]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.torrancerestoration.com/bbs/) Powered by Discuz! X3.1