2282 1616點(diǎn)陣LED電子顯示屏
2282 1616點(diǎn)陣LED電子顯示屏,點(diǎn)陣,led,電子顯示屏
16×16 點(diǎn)陣顯示屏成功點(diǎn)亮??!2009-04-17 09:59看到江同學(xué)的 3216屏(www.jiangx.net),對于我來說,稍顯復(fù)雜,所以決定做個(gè) 1616的屏看看效果,原理圖就是以下了,注意做 1616時(shí),要去掉一個(gè) 74LS154(當(dāng)然這里也能換用 74HC154,雖然功耗大,但價(jià)格較低),經(jīng)過兩天的奮斗,終于完工了。簡單的調(diào)試后,點(diǎn)亮了?。【巶€(gè)流動顯示的程序,哈哈,很炫啊。心動不如趕快行動?。?!我是把點(diǎn)陣塊焊到一塊板子上,可方便檢查有無虛焊,控制部分放到了另一張板上,做成的實(shí)物圖就是下面的了,視頻在這里:http://u.youku.com/springvirus (注:以下原理圖均來自 www.jiangx.net)/*********************************************************程序名稱:LED1616 點(diǎn)陣流動顯示漢字簡要說明:最大可顯示 16*16漢字P0口接上行線,P2 口接下行線,P3 口接掃描線編 寫: JiangX.net改 編: springvirus*********************************************************/#include #define hang1 P0 //上行線#define hang2 P2 //下行線#define lie P1 //列線#define sum sizeof(hanzi)/32 //自動計(jì)算漢字字?jǐn)?shù)/*****參數(shù)設(shè)置*****/#define ziti 16 //字體大小(寬度)#define light 50 //顯示亮度#define move_speed 50 //移動速度unsigned char code hanzi[]={/*-- 文字: 自 --*//*-- 宋體 12; 此字體下對應(yīng)的點(diǎn)陣為:寬 x高=16x16 --*/0x00,0x00,0x00,0xF8,0x48,0x48,0x4C,0x4B,0x4A,0x48,0x48,0x48,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0xFF,0x00,0x00,0x00,/*-- 文字: 制 --*//*-- 宋體 12; 此字體下對應(yīng)的點(diǎn)陣為:寬 x高=16x16 --*/0x00,0x50,0x4F,0x4A,0x48,0xFF,0x48,0x48,0x48,0x00,0xFC,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x3F,0x01,0x01,0xFF,0x21,0x61,0x3F,0x00,0x0F,0x40,0x80,0x7F,0x00,0x00,/*-- 文字: 小 --*//*-- 宋體 12; 此字體下對應(yīng)的點(diǎn)陣為:寬 x高=16x16 --*/0x00,0x00,0x00,0xC0,0x70,0x20,0x00,0xFF,0x00,0x10,0x20,0xC0,0x80,0x00,0x00,0x00,0x04,0x02,0x01,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x01,0x07,0x02,0x00,/*-- 文字: 型 --*//*-- 宋體 12; 此字體下對應(yīng)的點(diǎn)陣為:寬 x高=16x16 --*/0x10,0x12,0x92,0x7E,0x12,0x12,0xFE,0x12,0x12,0x10,0xFC,0x00,0x00,0xFF,0x00,0x00,0x40,0x42,0x49,0x48,0x48,0x48,0x49,0x7E,0x48,0x48,0x48,0x4A,0x4C,0x4B,0x40,0x00,/*-- 文字: 點(diǎn) --*//*-- 宋體 12; 此字體下對應(yīng)的點(diǎn)陣為:寬 x高=16x16 --*/0x00,0x00,0x00,0xE0,0x20,0x20,0x20,0x3F,0x24,0x24,0x24,0xF4,0x24,0x00,0x00,0x00,0x00,0x40,0x30,0x07,0x12,0x62,0x02,0x0A,0x12,0x62,0x02,0x0F,0x10,0x60,0x00,0x00,/*-- 文字: 陣 --*//*-- 宋體 12; 此字體下對應(yīng)的點(diǎn)陣為:寬 x高=16x16 --*/0xFE,0x02,0x12,0x2A,0xC6,0x88,0xC8,0xB8,0x8F,0xE8,0x88,0x88,0x88,0x88,0x00,0x00,0xFF,0x00,0x02,0x04,0x03,0x04,0x04,0x04,0x04,0xFF,0x04,0x04,0x04,0x04,0x04,0x00,/*-- 文字: 顯 --*//*-- 宋體 12; 此字體下對應(yīng)的點(diǎn)陣為:寬 x高=16x16 --*/0x00,0x00,0x00,0x3E,0x2A,0xEA,0x2A,0x2A,0x2A,0xEA,0x2A,0x3E,0x00,0x00,0x00,0x00,0x20,0x21,0x22,0x2C,0x20,0x3F,0x20,0x20,0x20,0x3F,0x28,0x24,0x23,0x20,0x20,0x00,/*-- 文字: 示 --*//*-- 宋體 12; 此字體下對應(yīng)的點(diǎn)陣為:寬 x高=16x16 --*/0x00,0x20,0x20,0x22,0x22,0x22,0x22,0xE2,0x22,0x22,0x22,0x22,0x22,0x20,0x20,0x00,0x10,0x08,0x04,0x03,0x00,0x40,0x80,0x7F,0x00,0x00,0x01,0x02,0x0C,0x18,0x00,0x00,/*-- 文字: 系 --*//*-- 宋體 12; 此字體下對應(yīng)的點(diǎn)陣為:寬 x高=16x16 --*/0x00,0x00,0x02,0x22,0xB2,0xAA,0x66,0x62,0x22,0x11,0x4D,0x81,0x01,0x01,0x00,0x00,0x00,0x40,0x21,0x13,0x09,0x05,0x41,0x81,0x7F,0x01,0x05,0x09,0x13,0x62,0x00,0x00,/*-- 文字: 統(tǒng) --*//*-- 宋體 12; 此字體下對應(yīng)的點(diǎn)陣為:寬 x高=16x16 --*/0x20,0x30,0x2C,0xA3,0x60,0x10,0x84,0xC4,0xA4,0x9D,0x86,0x84,0xA4,0xC4,0x84,0x00,0x20,0x22,0x23,0x12,0x12,0x92,0x40,0x30,0x0F,0x00,0x00,0x3F,0x40,0x41,0x70,0x00,/*****空白,用于區(qū)分顯示內(nèi)容的頭和尾*****/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};uint k=0,j; //移位變量,k:移位個(gè)數(shù)uint a=0; //用于軟件延時(shí) ulong s=(sum+1)*ziti; //s為全部列數(shù)uchar disbuf[16][2]; //定義顯示緩沖區(qū)(16 行兩列的二維數(shù)組以開辟 1個(gè) 16*16漢字的空間)bit move_st; //移動標(biāo)志/*****可變延時(shí)*****/void delay(void) {uchar i;for(i=0;i=move_speed) //move_speed控制移動速度{ if(k>s-ziti-1)k=0; //整屏移動列數(shù) k1=k/ziti;k2=k%ziti;j=ziti*2*k1+k2; //顯示指針 k++;move_st=1;a=0;} }/*****裝載顯示數(shù)據(jù)至緩沖區(qū)*****/void load_hanzi(void){ uchar i;run_move();if(move_st){ for(i=0;i<15;i++){disbuf[i][0]=disbuf[i+1][0];//移位處理disbuf[i][1]=disbuf[i+1][1];//移位處理} disbuf[15][0]=hanzi[j];disbuf[15][1]=(hanzi[ziti+j]); move_st=0; } }/*****掃描顯示數(shù)據(jù)緩沖區(qū)的內(nèi)容*****/void display(void){ uchar i;for (i=0;i<16;i++){lie=i; hang1=disbuf[i][0];hang2=disbuf[i][1];delay();hang1=0;hang2=0; }}/*****主程序*****/void main (void){ init();EA=1; //開中斷TR0=1; ET0=1; while(1){ load_hanzi();display(); }}
收藏