程序代码如下:
// program name: project5.c
// 功用: 选用循环结构完成流水灯的操控
#include
void delay (unsigned char i) {
unsigned char j, k;
for (k=0; k
for (j=0; j<255; j++);
}
void main () {
unsigned char i, w;
while (1) {
w=0x01;
for (i=0; i<8; i++) {
P1=~w;
delay(200);
w<<=1;
}
}
}
声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/yingyong/262756.html