标题:
红蓝闪烁灯程序和proteus仿真
[打印本页]
作者:
cigee001
时间:
2024-10-17 14:41
标题:
红蓝闪烁灯程序和proteus仿真
JD.png
(173.67 KB, 下载次数: 1)
下载附件
proteus仿真
2024-10-17 14:39 上传
单片机源程序如下:
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar code Pattern_1[]=
{
0x0A,0x05,0x0A,0x05,0x0A,0x05,0x0F
};
uchar code Pattern_2[]=
{
0x0A,0x05,0x0F,0x08,0x04,0x0C,0x02,0x01,0x03,0x0F
};
void DelayMS(uint x)
{
uchar t;
while(x--)
{
for(t=120;t>0;t--);
}
}
void main()
{
uchar i,m,j,k;
while(1)
{
for(i=0;i<7;i++)
{
for(m=0;m<3;m++)
{
P0=Pattern_1[i];
DelayMS(100);
P0=0;
DelayMS(100);
}
}
for(j=0;j<10;j++)
{
for(k=0;k<3;k++)
{
P0=Pattern_2[j];
DelayMS(100);
P0=0;
DelayMS(50);
}
}
}
}
复制代码
Proteus8.16仿真下载:
JD.7z
(35.83 KB, 下载次数: 4)
2024-10-18 00:40 上传
点击文件名下载附件
警灯
下载积分: 黑币 -5
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1