標(biāo)題:
51單片機(jī)跑馬燈代碼
[打印本頁]
作者:
wiselee
時間:
2020-11-11 23:01
標(biāo)題:
51單片機(jī)跑馬燈代碼
#include<reg52.h>
#include<intrins.h>
extern void delay_ms(void);
main(){
unsigned char temp;
int m;
while(1){
temp = 0xfe;
P0 = temp;
delay_ms();
for(m = 3;m >0;m --){
temp = _crol_(temp,1);
P0 = temp;
delay_ms();
}
}
return 1;
}
void delay_ms(void){
int i,k;
for(i = 9000;i>0;i--);
for(k = 80000;k>0;k--);
}
復(fù)制代碼
簡單好用
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1