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
|