#includereg51.h//unsignedcharcodeliushideng[]=(0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f);/*ledµÆ¹²ÑôĞÍ*/unsignedcharshumaguan[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};/*¹²ÑôĞÍÊıÂë¹Ü*/unsignedchari=0;sbitp20=P2^0;//ÊıÂë¹Üλ¿ØÖƶËsbitp21=P2^1;//ÊıÂë¹Üλ¿ØÖƶËsbitp22=P2^2;//ÊıÂë¹Üλ¿ØÖƶËsbitp23=P2^3;//ÊıÂë¹Üλ¿ØÖƶËvoidyanshi()//ÑÓʱº¯Êı{unsignedintx,y;for(x=0;x10;x++)for(y=0;y20;y++);}voidsmgxs(void)//ÊıÂë¹ÜÏÔʾº¯Êı{p20=1;//¿ªÍ¨Î»1P0=shumaguan[1];//¸³Öµyanshi();//ÑÓʱp20=0;//¹Ø±Õλ1p21=1;//¿ªÍ¨Î»2P0=shumaguan[2];//¸³Öµyanshi();//ÑÓʱp21=0;//¹Ø±Õλ2p22=1;//¿ªÍ¨Î»3P0=shumaguan[3];//¸³Öµyanshi();//ÑÓʱp22=0;//¿ªÍ¨Î»3p23=1;//¿ªÍ¨Î»4P0=shumaguan[4];//¸³Öµyanshi();//ÑÓʱP2=0XF0;//¹Ø±ÕËùÓĞλ}voidmain()/*Ö÷º¯Êı*/{while(1)//·ÀÖ¹³ÌĞòÅÜ·É{smgxs();//ÊıÂë¹ÜÏÔʾ}}