毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

汉字LED点阵16X16滚动显示设计

更新时间:2010-4-30:  来源:毕业论文

汉字LED点阵16X16滚动显示设计
#include <reg52.h>  #define int8 unsigned char #define int16 unsigned int #define int32 unsigned long  int8 flag; int8 n; int8 code table[][32]={                           {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/* "  " */                             {0x04,0x28,0x08,0x24,0x32,0x22,0xC2,0x21,0xC2,0x26,0x34,0x38,0x04,0x04,0x08,0x18,0x30,0xF0,0xC0,0x17,
0x60,0x10,0x18,0x10,0x0C, 0x14,0x06,0x18,0x04,0x10,0x00,0x00},/*"欢",0*/                         

  {0x02,0x02,0x04,0x82,0xF8,0x73,0x04,0x20,0x02,0x00,0xE2,0x3F,0x42,0x20,0x82,0x40,0x02,0x40,0xFA, 0x3F,0x02,0x20,0x42,0x20,0x22,0x20,0xC2,0x3F,0x02,0x00,0x00,0x00},/*"迎",1*/     
                       {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0
0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}/* "  " */                       };  void delay(void); int16 offset;  void main(void) {     int8 i;     int8 *p;     flag=0x10;     n=0;     TMOD=0x01;     TH0=0xb1;     TL0=0xe0;     ET0=1;     EA=1;     TR0=1;      p=&table[0][0];      while (1)     {         for (i=0;i<8;i++)    //显示左半边屏幕         {             P0=*(p+offset+2*i);             P2=i|0x08;    //P2.4=0,P2.3=1 选中U2, 输出扫描码给U6             delay();              P0=*(p+offset+2*i+1);             P2=i|0x10;   //P2.4=1,P2.3=0 选中U3, 输出扫描码给U7             delay();         }         for (i=8;i<16;i++)    
//显示右半边屏幕         {             P0=*(p+offset+2*i);             P2=(i-8)|0x20;   //P2.5=1 P2.4=0, P2.3=0 选中U4,输出扫描码U8             delay();              P0=*(p+offset+2*i+1);             P2=(i-8)|0x40;   //P2.6=1 P2.5=0, P2.4=0 选中U5,输出扫描码U9             delay();         }     } }   void delay(void) {     int16 i;     for (i=0;i<50;i++)         ; }   void timer0() interrupt 1 using 3 {     TF0=0;     TH0=0xb1;     TL0=0xe0;     if (n<10)     {     n++;     }     else     {     offset+=2;     if (offset>1100)             offset=0;         n=0;     } } 
<h2>Project:</h2>
C:\Documents and Settings\Administrator\桌面\16×16点阵(滚动显示)\16×16点阵(滚动显示)\16×16点阵.uv2
Project File Date:  11/17/2006

<h2>Output:</h2>
这个中断是为了产生offset的原理是什么,为什么能实现汉字的移动显示(从右至左)
{0x04,0x28,0x08,0x24,0x32,0x22,0xC2,0x21,0xC2,0x26,0x34,0x38,0x04,0x04,0x08,0x18,0x30,
0xF0,0xC0,0x17,0x60,0x10,0x18,0x10,0x0C, 0x14,0x06,0x18,0x04,0x10,0x00,0x00},/*"欢",0*/
需要源程序的找站长1066

汉字LED点阵16X16滚动显示设计下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。