標(biāo)題:
紅藍(lán)閃爍燈程序和proteus仿真
[打印本頁]
作者:
cigee001
時間:
2024-10-17 14:41
標(biāo)題:
紅藍(lán)閃爍燈程序和proteus仿真
JD.png
(173.67 KB, 下載次數(shù): 1)
下載附件
proteus仿真
2024-10-17 14:39 上傳
單片機(jī)源程序如下:
#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);
}
}
}
}
復(fù)制代碼
Proteus8.16仿真下載:
JD.7z
(35.83 KB, 下載次數(shù): 4)
2024-10-18 00:40 上傳
點擊文件名下載附件
警燈
下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1