標(biāo)題: 51單片機(jī)控制64位流水燈程序電路原理圖 [打印本頁]

作者: 馬上學(xué)習(xí)    時(shí)間: 2024-11-2 12:29
標(biāo)題: 51單片機(jī)控制64位流水燈程序電路原理圖
#include<reg51.h>

const unsigned char P0_arry[8]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};
//const unsigned char P0_arry[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
//const unsigned char P2_arry[8]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
const unsigned char P2_arry[8]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
void delay(unsigned int time)
{
    unsigned int i, j;
    for(i = 0; i < time; i++)
        for(j = 0; j < 120; j++);
}
void main()
{
  unsigned char i, j;

        while(1)
        {
                for(i=0;i<8;i++)
                {
                        P2 = P2_arry[ i];
                        for(j=0;j<8;j++)
                        {
                                P0 = P0_arry[j];
                                                                                                              delay(200);
                        }                       
                }
        }
}

單片機(jī)控制88點(diǎn)陣.png (156.03 KB, 下載次數(shù): 0)

單片機(jī)控制88點(diǎn)陣.png

屏幕截圖(33).png (168.83 KB, 下載次數(shù): 0)

屏幕截圖(33).png





歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1