找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2421|回复: 2
打印 上一主题 下一主题
收起左侧

这个数组怎么调用的。。。。。

[复制链接]
跳转到指定楼层
楼主
ID:72258 发表于 2015-8-11 11:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在学51,但是做到led点阵的时候,不明白这个数组怎么调用的。希望各位大神指点一下。(好像是C语言的问题,自己C学的太差了。。。。。
  1. unsigned char code tab2[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,252,252} ;

  2. unsigned char code tab3[] = {8,2,8,2,4,17,62,63,162,16,98,16,34,17,62,18,34,18,34,16,34,16,34,16,62,10,34,4,0,0,0,0};

  3. unsigned char code tab4[] = {0,16,190,63,2,2,186,31,170,16,170,20,170,20,186,20,138,20,138,20,170,20,26,10,1,49,193,32,0,0,0,0};

  4. unsigned char code tab5[] = {64,0,128,0,254,31,34,16,241,11,40,2,68,1,192,1,32,2,248,63,23,4,16,4,16,4,240,7,0,0,0,0};

  5. unsigned char code tab6[] = {0,1,0,1,63,1,32,63,162,32,148,18,84,2,8,2,8,2,20,5,36,5,162,8,65,16,32,32,0,0,0,0};

  6. unsigned char code tab7[] = {2,1,196,16,36,62,32,18,32,18,39,18,36,18,164,18,100,18,36,26,4,2,10,2,49,0,192,63,0,0,0,0};

  7. unsigned char code tab8[] = {16,2,16,18,232,63,8,2,204,31,74,18,73,18,200,31,8,18,72,2,136,2,8,1,136,6,104,56,0,0,0,0};

  8. unsigned char code tab9[] = {0,8,252,31,132,8,132,8,252,15,132,8,132,8,132,8,252,15,132,8,132,8,130,8,130,10,129,4,0,0,0,0};

  9. unsigned char code tab10[] = {16,2,32,1,254,31,32,1,36,9,40,5,255,63,0,0,248,7,8,4,248,7,8,4,8,4,248,7,0,0,0,0}        ;

  10. unsigned char code tab11[] = {64,0,64,0,64,8,254,31,66,8,66,8,66,8,66,8,254,15,64,0,64,0,64,0,64,0,64,0,0,0,0,0};

  11. unsigned char code tab12[] = {0,8,254,31,16,2,16,2,16,2,16,18,255,63,16,2,16,2,16,2,16,2,8,2,4,2,3,2,0,0,0,0};

  12. unsigned char code tab13[] = {32,2,36,4,36,4,34,16,254,63,32,0,224,15,80,8,80,4,136,2,8,1,132,2,98,60,29,16,0,0,0,0};

  13. unsigned char code tab14[] = {4,8,4,30,196,1,95,0,196,15,68,8,78,9,86,9,69,5,69,5,68,2,36,5,164,56,84,16,0,0,0,0};

  14. unsigned char code tab15[] = {0,0,0,0,60,240,102,156,67,130,0,0,0,0,0,0,0,0,0,0,48,24,96,8,192,7,0,0,0,0,0,0};

  15. unsigned char code tab16[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};


  16. void main(void)
  17. {   
  18.         int k, j, ms;
  19.        
  20.         //--定义一个指针数组指向每个汉字--//
  21.         uchar *p[] =
  22.                     {tab17, tab1, tab2, tab3, tab4, tab5, tab6, tab7, tab8,
  23.                      tab9, tab10, tab11, tab12, tab13, tab14, tab15, tab16};                                               
  24.         while(1)
  25.         {

  26.                 for(ms = 20; ms > 0; ms--)        //移动定格时间设置
  27.                 {
  28.                         for(k = 0; k < 16; k++)        //显示一个字
  29.                         {                                                        
  30.                                 HC595SendData(~(*(p[0] + 2*(k+j) + 1)),~(*(p[0] + 2*(k+j) )),tab0[2*k],tab0[2*k + 1]);
  31.                                 //因为字模软件取的数组是高电平有效,所以列要取反                   
  32.                         }
  33.                        
  34.                         //--清屏--//
  35.                         HC595SendData(0xff,0xff,0,0);                                 //清屏                 
  36.                 }

  37.                
  38.                 j++;
  39.                 if(j == (17*15) )
  40.                 {
  41.                         j = 0;
  42.                 }
  43.                
  44.         }                                                                               
  45. }
复制代码




分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:74784 发表于 2015-8-11 20:16 | 只看该作者
c语言不行 就用汇编嘛~~~~~~~~~~~~~
回复

使用道具 举报

板凳
ID:72258 发表于 2015-8-14 03:14 | 只看该作者
lxa0 发表于 2015-8-11 20:16
c语言不行 就用汇编嘛~~~~~~~~~~~~~

。。。不会会汇编。。。。。
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表