注册 登录
电子工程世界-论坛 返回首页 EEWORLD首页 频道 EE大学堂 下载中心 Datasheet 专题
whuzhushu的个人空间 https://home.eeworld.com.cn/space-uid-525672.html [收藏] [复制] [分享] [RSS]
日志

我是新人一个,想编一个16*16LED点阵显示汉字的程序,但死活编不出,自己估计是电...

已有 1212 次阅读2014-2-23 22:18

#include "io430.h"
int main()
{
  unsigned int i,j;
  unsigned int a[]={0x01,0x00,0x11,0x00,0x11,0x10,0x1f,0xf8,0x11,0x00,0x21,
                    0x00,0x01,0x04,0xff,0xfe,0x03,0x00,0x05,0x80,0x09,0x40,
                    0x11,0x30,0x21,0x0e,0xc1,0x04,0x01,0x00,0x01,0x00};   //行显示朱字  
  //unsigned int b[]={0x01,0x04,0x01,0x05,0x08,0x79,0x10,0x11,0x20,0x11,0x40,
                   // 0x11,0x80,0xff,0xff,0x11,0x40,0x11,0x20,0x11,0x10,0x31,
                    //0x10,0x11,0x08,0x03,0x0c,0x0c,0x01,0x08,0x00,0x00};
  //unsigned int a[]={0x00,0x08,0x01,0x02,0x7a,0xf3,0x4e,0x92,\
0x4a,0x92,0x7a,0x92,0x4B,0xfe,0x4a,0x94,\
0x4a,0x94,0x7a,0x94,0x4a,0xfc,0x4a,0x06,\
0xfa,0x01,0x47,0xfe,0x02,0x00,0x00,0x00};
  int c[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,
                    0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
  // Stop watchdog timer to prevent time out reset
  WDTCTL = WDTPW + WDTHOLD;
  P1DIR=0xff;P2DIR=0xff;
  P3DIR=0xff;P4DIR=0xff;
  while(1)
  {
    for(i=0;i<80;i++) {P1OUT=0x01;P2OUT=0x00;P3OUT=0xfe;P4OUT=0xff;}
    for(i=0;i<80;i++) {P1OUT=0x11;P2OUT=0x00;P3OUT=0xfd;P4OUT=0xff;}
    for(i=0;i<80;i++) {P1OUT=0x11;P2OUT=0x10;P3OUT=0xfb;P4OUT=0xff;}
    for(i=0;i<80;i++) {P1OUT=0x1f;P2OUT=0xf8;P3OUT=0xf7;P4OUT=0xff;}
    for(i=0;i<80;i++) {P1OUT=0x11;P2OUT=0x00;P3OUT=0xef;P4OUT=0xff;}
    for(i=0;i<80;i++) {P1OUT=0x21;P2OUT=0x00;P3OUT=0xdf;P4OUT=0xff;}
    for(i=0;i<80;i++) {P1OUT=0x01;P2OUT=0x04;P3OUT=0xbf;P4OUT=0xff;}
    for(i=0;i<80;i++) {P1OUT=0xff;P2OUT=0xfe;P3OUT=0x7f;P4OUT=0xff;}
    for(i=0;i<80;i++) {P1OUT=0x03;P2OUT=0x00;P3OUT=0xff;P4OUT=0xfe;}
    for(i=0;i<80;i++) {P1OUT=0x05;P2OUT=0x80;P3OUT=0xff;P4OUT=0xfd;}
    for(i=0;i<80;i++) {P1OUT=0x09;P2OUT=0x40;P3OUT=0xff;P4OUT=0xfb;}
    for(i=0;i<80;i++) {P1OUT=0x11;P2OUT=0x30;P3OUT=0xff;P4OUT=0xf7;}
    for(i=0;i<80;i++) {P1OUT=0x21;P2OUT=0x0e;P3OUT=0xff;P4OUT=0xef;}
    for(i=0;i<80;i++) {P1OUT=0xc1;P2OUT=0x04;P3OUT=0xff;P4OUT=0xdf;}
    for(i=0;i<80;i++) {P1OUT=0x01;P2OUT=0x00;P3OUT=0xff;P4OUT=0xbf;}
    for(i=0;i<80;i++) {P1OUT=0x01;P2OUT=0x00;P3OUT=0xff;P4OUT=0x7f;}
  }
}

程序如上,我是新人一个,想编一个16*16LED点阵显示汉字的程序,但死活编不出,自己估计是电路有问题,求大神指教。如果大神能帮忙修改一下电路或者给个示例就最好了,多谢!

本文来自论坛,点击查看完整帖子内容。

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

热门文章