#include <reg51.h> sbit L1=P2^0; //定义控制显示的两个端口 sbit L2=P2^1; code unsigned char DispBuf[10]={0x3f,0x06,0x5b,0x4f,0x66, 0x6d,0x7d,0x07,0x7f,0x6f}; void dellay(unsigned int h) { while(h--); } main() { unsigned char i=0; unsigned char count=1; while(1) { dellay(60000); P1=DispBuf[i++]; if(i==0) //动态主程序的开始 { L1=0; L2=0; dellay(30000); L1=1; L2=1; dellay(30000); } if(i==1) { L1=0; L2=0; dellay(30000); L1=1; L2=1; dellay(30000); } if(i==2) { L1=0; L2=0; dellay(30000); L1=1; L2=1; dellay(30000); } if(i==3) { L1=0; L2=0;