4532|10

63

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

关于点阵数据转换问题 [复制链接]

大家好,我想把一个数组的数据中的每一位提取出来,变成另外一个只有一位有效位的数组.
    例如:一个8*8点阵第一排的显示数据为0x8e,即 1 0 0 0 1 1 1 0 ,我想把这几个变成另外一个数组,如下
                  * * * * * * * 1
                  * * * * * * * 0
                  * * * * * * * 0
                  * * * * * * * 0
                  * * * * * * * 1
                  * * * * * * * 1
                  * * * * * * * 1
                  * * * * * * * 0
        *号代表任意数字。变后数组为{0x*1,0x*0,0x*0,0x*0,0x*1,0x*1,0x*1,0x*0}
  

最新回复

下面是参照一本书写的 #include #define Dw 64 //显示区域长度 #define Dh 16 //显示区域高度 #define Lw 64 //LED屏宽度 #define Lh 16 //LED屏高度 #define Sw 16 //扫描宽度 #define EN_ON 1 #define EN_OFF 0 sfr Ctrl_port=0xa0; sfr Data_port=0x80; sbit E=P2^5; //显示允许控制端 sbit RCK=P2^6;//锁存信号 sbit SCK=P2^7;//移位信号 unsigned char code Display_Font[64][16]= { /*新*/   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,  0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x03, //2   0x03,0x03,0x03,0x03,0x01,0x03,0x01,0x03,  0x03,0x03,0x03,0x01,0x01,0x01,0x03,0x03,   0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,  0x01,0x01,0x01,0x01,0x03,0x03,0x03,0x03, //3   0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,  0x03,0x01,0x01,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x02,0x02,0x02,0x02,0x02,  0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x01,0x01,0x01,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, //4   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,  0x03,0x01,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x02,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x01,0x03,0x01,0x01,0x03,0x01,0x01,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, //5   0x03,0x03,0x01,0x03,0x03,0x03,0x01,0x03,  0x03,0x01,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x02,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x01,0x03,0x01,0x03,0x01,0x03,0x03,  0x01,0x01,0x01,0x01,0x01,0x01,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   //6   0x03,0x03,0x03,0x01,0x03,0x01,0x03,0x03,  0x03,0x01,0x03,0x03,0x03,0x01,0x03,0x03,   0x03,0x02,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x02,0x03,0x03,0x03,0x03,   0x03,0x01,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   //7   0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,  0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x03,   0x03,0x03,0x03,0x02,0x02,0x02,0x02,0x02,  0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,   0x01,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   //8   0x03,0x03,0x03,0x01,0x03,0x01,0x03,0x03,  0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x02,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,      //9   0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x03,  0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x02,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   //10   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x02,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x02,0x03,0x03,   0x03,0x03,0x03,0x01,0x01,0x01,0x01,0x01,  0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x03,   0x03,0x01,0x03,0x03,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x01,0x03,0x03,   //11   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,   0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,  0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,  0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x03,   //12   0x03,0x03,0x01,0x01,0x03,0x01,0x03,0x03,  0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x01,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x01,  0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x03,   //13   0x03,0x01,0x03,0x01,0x03,0x03,0x01,0x01,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,   //14   0x01,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x03,0x01,0x03,  0x03,0x03,0x03,0x01,0x01,0x01,0x03,0x03,   0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x01,0x01,0x03,0x03,0x03,   //15   0x03,0x01,0x03,0x01,0x03,0x03,0x01,0x03,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x03,0x01,0x03,0x03,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x01,0x03,0x03,0x03,0x01,0x03,0x01,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   //16   0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,   0x03,0x03,0x03,0x01,0x01,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,   0x03,0x03,0x03,0x03,0x03,0x03,0x01,0x03,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03 }; void display(unsigned int XL,unsigned int YL,unsigned int display_count) {         unsigned char line;         unsigned char col;         unsigned char code *ram_point ;         unsigned int k,ram_begin_addr;         for(k=0;k  详情 回复 发表于 2010-2-18 21:09
点赞 关注

回复
举报

47

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
这样岂不是很浪费空间?一个字节只有一位有用。能否说明一下这样做的意义?
 
 

回复

68

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
   我知道这样浪费空间,我在做点阵实验时,输出数据位只有一位,也就是只有一个端口(如 P0 )8位数据中的一位输出数据,其它位没用。也就是串行发送,然后通过电路并口输出。这是由硬件电路决定的。这样做就是以空间换取显示时间。但我只要能正确显示,对时间要求不那么高.
 
 
 

回复

92

帖子

0

TA的资源

一粒金砂(初级)

4
 
为什么,,要那么麻烦,把原来的数组带进位标志位C左移动或右移动,然后用为传送指令将C的值送往IO口指定的位不就行了吗
 
 
 

回复

70

帖子

0

TA的资源

一粒金砂(初级)

5
 
// This function turn the 16*16 Hz for 90 degree.
// Input :BYTE *OneChar points a 16*16 HZ(2*16 bytes)
// Output:90 degree turned HZ
void Turn90_16(BYTE *OneChar)
{
        int rr,cc;
        WORD row[16];
        WORD col[16];
//init
        memset(row,0,sizeof(row));
        memset(col,0,sizeof(col));
//a row has 2 bytes
        for (rr=0;rr<16;rr++)
        {
                row[rr]=(OneChar[2*rr]<<8)+OneChar[2*rr+1];
        }
//
        for (cc=0;cc<16;cc++)
        {// 16 columns
                for (rr=0;rr<16;rr++)
                {// 16 rows
                        if(row[rr] & (1< //                        if(row[rr] & (1<                 }
        }
//
        for(rr=0;rr<16;rr++)
        {// fill new
                OneChar[2*rr]  =(unsigned char)((col[rr] & 0xFF00)>>8);
                OneChar[2*rr+1]=(unsigned char) (col[rr] & 0xFF);
        }
}
 
 
 

回复

88

帖子

0

TA的资源

一粒金砂(初级)

6
 
不太明白楼上的意思,大家可以去这里看一下。
[url=http://topic.eeworld.net/u/20100216/19/3bfd630b-4ee2-4854-a84a-67abae0dcc53.html?64677][/url]
 
 
 

回复

69

帖子

0

TA的资源

一粒金砂(初级)

7
 
好难哦,有点看不懂哎
 
 
 

回复

63

帖子

0

TA的资源

一粒金砂(初级)

8
 
把每个子模的你想用的那个位通过程序移位一下,如<< >>(左移,右移),把其他位全置1或置0,反正让其他位控制为全部不亮。然后移位后的子模通过移位寄存器串行并出就是你要的数据。
 
 
 

回复

58

帖子

0

TA的资源

一粒金砂(初级)

9
 
void sendline()
{
char s;

uchar inc,temp,tempcol;

if(move<8) inc=0;
else inc=1;

for(s=9+inc;s>=0+inc;s--)
{
  if(move<8) tempcol=move;
  else tempcol=move-8;

  temp=(BUFF<>(8-tempcol)); //字模左边字节左移tempcol位,
               //右边字节右移8-tempcol位,2者相或
  SBUF=temp;  //把BUFF中的字节从右到左移位、相或 后发送输出
  while(TI==0); //等待发送完毕 while(!TI);
  TI=0;
}
}

这是我做点阵的时候用到的一段移位上用的代码,希望有帮助,呵呵

 
 
 

回复

70

帖子

0

TA的资源

一粒金砂(初级)

10
 
顶~~~~~~~~~~~~~~~~~
 
 
 

回复

65

帖子

0

TA的资源

一粒金砂(中级)

11
 
下面是参照一本书写的

#include
#define Dw 64 //显示区域长度
#define Dh 16 //显示区域高度
#define Lw 64 //LED屏宽度
#define Lh 16 //LED屏高度
#define Sw 16 //扫描宽度
#define EN_ON 1
#define EN_OFF 0

sfr Ctrl_port=0xa0;
sfr Data_port=0x80;


sbit E=P2^5; //显示允许控制端
sbit RCK=P2^6;//锁存信号
sbit SCK=P2^7;//移位信号



unsigned char code Display_Font[64][16]=
{
/*新*/
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,  0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x03,
//2
  0x03,0x03,0x03,0x03,0x01,0x03,0x01,0x03,  0x03,0x03,0x03,0x01,0x01,0x01,0x03,0x03,
  0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,  0x01,0x01,0x01,0x01,0x03,0x03,0x03,0x03,
//3
  0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,  0x03,0x01,0x01,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x02,0x02,0x02,0x02,0x02,  0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x01,0x01,0x01,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
//4
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,  0x03,0x01,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x02,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x01,0x03,0x01,0x01,0x03,0x01,0x01,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
//5
  0x03,0x03,0x01,0x03,0x03,0x03,0x01,0x03,  0x03,0x01,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x02,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x01,0x03,0x01,0x03,0x01,0x03,0x03,  0x01,0x01,0x01,0x01,0x01,0x01,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  //6
  0x03,0x03,0x03,0x01,0x03,0x01,0x03,0x03,  0x03,0x01,0x03,0x03,0x03,0x01,0x03,0x03,
  0x03,0x02,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x02,0x03,0x03,0x03,0x03,
  0x03,0x01,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,

  //7
  0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,  0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x03,
  0x03,0x03,0x03,0x02,0x02,0x02,0x02,0x02,  0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,
  0x01,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,

  //8
  0x03,0x03,0x03,0x01,0x03,0x01,0x03,0x03,  0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x02,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  
  //9
  0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x03,  0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x02,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,

  //10
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x02,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x02,0x03,0x03,
  0x03,0x03,0x03,0x01,0x01,0x01,0x01,0x01,  0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x03,
  0x03,0x01,0x03,0x03,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x03,0x03,0x01,0x03,0x03,

  //11
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,
  0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,  0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,  0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,  0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x03,

  //12
  0x03,0x03,0x01,0x01,0x03,0x01,0x03,0x03,  0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x01,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x01,  0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x03,

  //13
  0x03,0x01,0x03,0x01,0x03,0x03,0x01,0x01,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x01,0x03,0x03,0x03,0x03,

  //14
  0x01,0x03,0x03,0x01,0x03,0x03,0x03,0x01,  0x01,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x03,0x01,0x03,  0x03,0x03,0x03,0x01,0x01,0x01,0x03,0x03,
  0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x01,  0x03,0x03,0x03,0x01,0x01,0x03,0x03,0x03,

  //15
  0x03,0x01,0x03,0x01,0x03,0x03,0x01,0x03,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x03,0x01,0x03,0x03,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x01,0x03,0x03,0x03,0x01,0x03,0x01,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,

  //16
  0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  0x03,0x03,0x03,0x01,0x01,0x03,0x03,0x03,  0x03,0x03,0x03,0x03,0x01,0x03,0x03,0x03,
  0x03,0x03,0x03,0x03,0x03,0x03,0x01,0x03,  0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03

};


void display(unsigned int XL,unsigned int YL,unsigned int display_count)
{
        unsigned char line;
        unsigned char col;
        unsigned char code *ram_point ;
        unsigned int k,ram_begin_addr;
        for(k=0;k         {
                for(line=0;line                 {
                        ram_begin_addr=Display_Font;
                        ram_point=ram_begin_addr+YL*Dw+XL+line*Dw        ;
                        E=EN_ON;
                        for(col=Lw;col>0;col--)
                        {
                          Data_port=*ram_point;
                                SCK=0;
                                SCK=1;
                                ram_point++;
                        }
                        E=EN_OFF;
                        RCK=0;
                        RCK=1;
                        Ctrl_port=Ctrl_port&0xe0;
                        Ctrl_port=Ctrl_port|line;
                                       
                }
        }
}
void main(void)
{
        unsigned int XL,YL,y,count=200;
       
        while(1)
        {       
                for(XL=0;XL                         display(XL,0,count);//左移
                }


}


这就是显示“新年快乐”那原程序,大家看能否改简单一点。
显示效果为
[url=http://img20.ph.126.net/TfC2c-T1sDHZ2BaJM8nCAw==/3170815612647392231.jpg][/url]
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

关闭
站长推荐上一条 1/10 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表