基于STC89C52单片机流水灯设计

时间:2026-02-15 23:28:43

1、1.电脑软件准备

<1>,STC_ISP_V480 程序下载软件

<2>,Keil uVision4 编程软件

<3>,ISIS  仿真软件

2、2.STC89C52芯片

基于STC89C52单片机流水灯设计

3、3.单片机最小系统板

基于STC89C52单片机流水灯设计

4、4.STC89C52单片机程序

#include <reg52.h>

#define uchar unsigned char

#define uint unsigned int

uchar code Pattern_P0[]=

{

  0xfc,0xf9,0xf3,0xe7,0xcf,0x9f

};

uchar code Pattern_P2[]=

{

  0xf5,0xf6,0xfe,0x54,0x56,0x76,0xd7,0x49,0xa9,0xe4,0xc6

};

void DelayMS(uint x)

{

  uchar t;

while(x--)

{

for(t=120;t>0;t--);

}

}

void main()

{

  uchar i;

while(1)

{

for(i=136;i>0;i--)

{

P0=Pattern_P0[i];

P2=Pattern_P2[i];

DelayMS(2000);

}

}

}

5、5.ISIS仿真

基于STC89C52单片机流水灯设计

© 2026 小度经验网
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com