51单片机 74LS138译码器流水灯+Proteus仿真

51单片机 74LS138译码器流水灯+Proteus仿真


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

实例代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#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()
{
P2 = 0x00;
while(1)
{
P2 = (P2+1)%8;
Delay(200);
}
}

程序源码和仿真资源

1
2
3
链接:https://pan.baidu.com/s/1NfpE75vKDVNFf\_549G7mEQ 
提取码:1yi2