标题: 从左到右循环依次点亮的流水灯 走马灯单片机仿真和程序 [打印本页]

作者: heicad    时间: 2016-8-15 14:14
标题: 从左到右循环依次点亮的流水灯 走马灯单片机仿真和程序

  说明:从左到右循环依次点亮的流水灯接在P0口的8个LED 从左到右循环依次点亮,
  产生走马灯效果
附:PROTEUS仿真文件,与KEIL原代码,C语言,亲手制作,亲测可用

  1. /*  名称:从左到右的流水灯
  2.   说明:接在P0口的8个LED 从左到右循环依次点亮,
  3.   产生走 马灯效果 */

  4. #include<reg51.h>
  5. #include<intrins.h>
  6. #define uchar unsigned char
  7. #define uint unsigned int

  8.         //延时
  9. void Delayms(uint x)
  10. {  
  11.         uchar i,j;
  12.                  
  13.                   for(i=x;i>0;i--)
  14.                           for(j=115;j>0;j--);   
  15.   }

  16. void main()
  17. {
  18.         P0=0XFE;

  19.         while(1)
  20.         {
  21.                 P0=_crol_(P0,1);
  22.                 Delayms(1500);
  23.         }

  24. }
复制代码




跑马灯_LED.zip

133.5 KB, 下载次数: 25, 下载积分: 黑币 -5


作者: xxx200861    时间: 2018-4-2 16:15
有汇编的吗
作者: 阿斯达请问    时间: 2018-4-2 20:00
这可以有
作者: 970470320    时间: 2018-10-20 14:30
谢谢楼主楼主666




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