找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

帖子
查看: 3745|回復(fù): 5
打印 上一主題 下一主題
收起左側(cè)

51單片機8*8點陣滾動我愛你程序求解答

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:840202 發(fā)表于 2020-11-9 22:14 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
#include<reg51.h>
unsigned char code image[]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
        0xC3,0xE7,0xE7,0xE7,0xE7,0xE7,0xC3,0xFF,
        0x99,0x00,0x00,0x00,0x81,0xC3,0xE7,0xFF,
  0x99,0x99,0x99,0x99,0x99,0x81,0xC3,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};   //24個
unsigned char code TAB[8]  = {0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};

void main(){
  EA=1;
        TMOD=0x01;
        TH0=0xfc;
        TL0=0x67;
        ET0=1;
        TR0=1;
        while(1);


}
void int0() interrupt 1{

        static unsigned char i=0;
        static unsigned char tmr=0;
        static unsigned char index=0;
        TH0=0xfc;
        TL0=0x67;
       
        P0=0xff;
        switch(i){
       
                case 0: P1=TAB[7];i++;P0=image[index+0]; break;
                case 1: P1=TAB[6];i++;P0=image[index+1]; break;
                case 2: P1=TAB[5];i++;P0=image[index+2]; break;
                case 3: P1=TAB[4];i++;P0=image[index+3]; break;
                case 4: P1=TAB[3];i++;P0=image[index+4]; break;
                case 5: P1=TAB[2];i++;P0=image[index+5]; break;
                case 6: P1=TAB[1];i++;P0=image[index+6]; break;
                case 7: P1=TAB[0];i=0;P0=image[index+7]; break;
          default: break;
        }
tmr++;
        if(tmr>=250){
       
                  tmr=0;
                  index++;
                  if(index>=32){
                        index=0;
                        }
               
        }
       
       
}
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏1 分享淘帖 頂 踩
回復(fù)

使用道具 舉報

沙發(fā)
ID:414556 發(fā)表于 2020-11-10 09:37 | 只看該作者
你的問題是什么?
回復(fù)

使用道具 舉報

板凳
ID:840202 發(fā)表于 2020-11-11 10:52 | 只看該作者
if(tmr>=250)這個
回復(fù)

使用道具 舉報

地板
ID:483865 發(fā)表于 2020-11-11 14:16 | 只看該作者
TH0=0xfc;
TL0=0x67;定義刷新頻率

if(tmr>=250)是每個image的刷新總時間。
回復(fù)

使用道具 舉報

5#
ID:339654 發(fā)表于 2020-11-11 16:55 | 只看該作者
8*8不能顯示漢字,控制原理類似于多位數(shù)碼管動態(tài)顯示
回復(fù)

使用道具 舉報

6#
ID:547021 發(fā)表于 2020-11-12 10:55 | 只看該作者
寫這種點陣輸出字符的程序,最好找一個漢字取模軟件
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表