51单片机 74HC154译码器制作流水灯+Proteus仿真

51单片机 74HC154译码器制作流水灯+Proteus仿真


  • Proteus仿真
    在这里插入图片描述

实例代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <reg52.h>
#define uint unsigned int
#define uchar unsigned char

void Delay(uint x)
{
uchar i;
while(x--)
{
for(i=0;i<120;i++);
}
}

void main()
{
while(1)
{
P2 = (P2+1)%16;
Delay(50);
}
}

源码和仿真资源

1
2
3
链接:https://pan.baidu.com/s/1NLknGxFh2jtiR85cK9C4IA 
提取码:32hf