(如果想要程序源码,请在下方留言)
/* 名称:从左到右的流水灯
说明:接在P0口的8个LED从左到右循环依次点亮,产生走马灯效果
#include
#include
#define uchar unsigned char
#define uint unsigned int
//延时
void DelayMS(uint x)
uchar i;
while(x--)
for(i=0;i<120;i++);
//主程序
void main()
P0=0xfe;
while(1)
P0=_crol_(P0,1); //P0的值向左循环移动
DelayMS(150);
智力趣味题
特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。
Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.