标题: 单片机从左到右的流水灯proteus仿真 [打印本页]

作者: 51黑ff    时间: 2016-9-25 18:19
标题: 单片机从左到右的流水灯proteus仿真
  1. #include <reg52.h>
  2. #include <intrins.h>
  3. #define uchar unsigned char
  4. #define uint unsigned int

  5. void DelayMS(uint x)
  6. {
  7.          uchar i;
  8.         while(x--)
  9.         {
  10.                  for(i=120;i>0;i--);
  11.         }
  12. }

  13. void main()
  14. {
  15.          P0 = 0xFE;
  16.         while(1)
  17.         {
  18.                  P0 = _crol_(P0,1);
  19.                 DelayMS(150);
  20.         }
  21. }
复制代码

从左到右的流水灯.zip

47.55 KB, 下载次数: 16, 下载积分: 黑币 -5






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1