新聞中心

EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 基于單片機(jī)的點(diǎn)陣式LED滾動(dòng)漢字顯示屏仿真設(shè)計(jì)

基于單片機(jī)的點(diǎn)陣式LED滾動(dòng)漢字顯示屏仿真設(shè)計(jì)

作者: 時(shí)間:2013-01-18 來(lái)源:網(wǎng)絡(luò) 收藏

  利用C語(yǔ)言實(shí)現(xiàn)“2008北京歡迎您!”10個(gè)字的滾動(dòng)顯示,阿拉伯?dāng)?shù)字和標(biāo)點(diǎn)符號(hào)按16×8點(diǎn)陣編碼,漢字按16×16點(diǎn)陣編碼, “2008北京歡迎您!”字型碼表如下:

  {0x00,0x00,0x0C,0x1C,0x10,0x24,0x10,0x24,0x10,0x44,0x10,0x84,0x0F,0x0E,0x00,0x00},

  {0x00,0x00,0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},

  {0x00,0x00,0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},

  {0x00,0x00,0x0E,0x38,0x11,0x44,0x10,0x84,0x10,0x84,0x11,0x44,0x0E,0x38,0x00,0x00},

  {0x00,0x00,0x0E,0x04,0x08,0x0C,0x08,0x0C,0x08,0x08,0x08,0x10,0xFF,0xFE,0x00,0x00},

  {0x00,0x00,0x3F,0xFC,0x41,0x02,0x42,0x02,0x06,0x02,0x0E,0x06,0x0C,0x0C,0x00,0x00},

  {0x00,0x00,0x20,0x04,0x20,0x08,0x27,0x98,0x24,0xB0,0x24,0x82,0xA4,0x81,0x64,0xFE},

  {0x24,0x80,0x24,0x80,0x24,0xA0,0x27,0xB0,0x60,0x1C,0x20,0x08,0x00,0x00,0x00,0x00},

  {0x28,0x04,0x24,0x08,0x22,0x32,0x21,0xC2,0x26,0xC2,0x38,0x34,0x04,0x04,0x18,0x08},

  {0xF0,0x30,0x17,0xC0,0x10,0x60,0x10,0x18,0x14,0x0C,0x18,0x06,0x10,0x04,0x00,0x00},

  {0x02,0x02,0x82,0x04,0x73,0xF8,0x20,0x04,0x00,0x02,0x3F,0xE2,0x20,0x42,0x40,0x82},

  {0x40,0x02,0x3F,0xFA,0x20,0x02,0x20,0x42,0x20,0x22,0x3F,0xC2,0x00,0x02,0x00,0x00},

  {0x01,0x00,0x02,0x04,0x0C,0x1C,0x3F,0xC0,0xC0,0x1C,0x09,0x02,0x16,0x02,0x60,0x92},

  {0x20,0x4A,0x2F,0x82,0x20,0x02,0x24,0x0E,0x22,0x00,0x31,0x90,0x20,0x0C,0x00,0x00},

  {0x00,0x00,0x00,0x08,0x1F,0xDC,0x3F,0x08,0x3C,0x00,0x30,0x00,0x00,0x00,0x00,0x00},

  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}。

基于單片機(jī)的點(diǎn)陣式LED滾動(dòng)漢字顯示屏仿真設(shè)計(jì)


(a)主程序流程圖 (b)中斷服務(wù)程序流程圖

圖3. 程序流程圖

  動(dòng)態(tài)掃描顯示程序代碼如下:

  while (1)

  {for (i=0;i8;i++) //顯示左半邊屏幕

  { P0=*(p+offset+2*i);

  P2=i|0x90; //P2.4=1,P2.3=0 選中U3, 輸出掃描碼給U7

  delay();

  P0=*(p+offset+2*i+1);

  P2=i|0x08; //P2.4=0,P2.3=1 選中U2, 輸出掃描碼給U6

  delay(); }

  for (i=8;i16;i++) //顯示右半邊屏幕

  { P0=*(p+offset+2*i);

  P2=(i-8)|0xC0; //P2.6=1 P2.5=0, P2.4=0 選中U5,輸出掃描碼U9

  delay();

  P0=*(p+offset+2*i+1);

  P2=(i-8)|0x20; //P2.5=1 P2.4=0, P2.3=0 選中U4,輸出掃描碼U8

  delay();

  } }

led顯示器相關(guān)文章:led顯示器原理


上拉電阻相關(guān)文章:上拉電阻原理


評(píng)論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉