限时福利:在电子开发圈-公众号-首页发送“免费”,即可无限畅读本文 !!!
1、51单片机+Proteus8.10;
2、循环折返流水灯,学习C语言基础语法;
#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned intvoid delay_ms(uint x)
{uchar t;while(x--){for(t=120;t>0;t--);}
}void main()
{uchar i;P0=0xFE;while(1){for(i=7;i>0;i--){P0=_crol_(P0,1);delay_ms(200);}for(i=7;i>0;i--){P0=_cror_(P0,1);delay_ms(200);}}
}
本文发布于:2024-01-27 20:06:42,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/17063572012360.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |