【Proteus仿真】74LS138译码器流水灯

【Proteus仿真】74LS138译码器流水灯


示例代码

#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(500);
	}
}

仿真资源和程序代码

链接:https://pan.baidu.com/s/1LUhvRK9ADBfZWS5zcVEUSA 
提取码:0dy8

  当顺的时候生活的意义就是活的更好当不顺的时候生活的意义就是活着。

猜你喜欢

转载自blog.csdn.net/weixin_42880082/article/details/125410707
今日推荐