16x16点阵LED滚动显示汉字.docx

上传人:b****3 文档编号:5453271 上传时间:2022-12-16 格式:DOCX 页数:6 大小:16.58KB
下载 相关 举报
16x16点阵LED滚动显示汉字.docx_第1页
第1页 / 共6页
16x16点阵LED滚动显示汉字.docx_第2页
第2页 / 共6页
16x16点阵LED滚动显示汉字.docx_第3页
第3页 / 共6页
16x16点阵LED滚动显示汉字.docx_第4页
第4页 / 共6页
16x16点阵LED滚动显示汉字.docx_第5页
第5页 / 共6页
点击查看更多>>
下载资源
资源描述

16x16点阵LED滚动显示汉字.docx

《16x16点阵LED滚动显示汉字.docx》由会员分享,可在线阅读,更多相关《16x16点阵LED滚动显示汉字.docx(6页珍藏版)》请在冰豆网上搜索。

16x16点阵LED滚动显示汉字.docx

16x16点阵LED滚动显示汉字

#include

#include

/*

 RCS2--->PC0

 CCS1--->PC1

 CCS2--->PC2

 RCS1--->PC3'=1

*/

#defineRCS1_1PORTC|=BIT(PORTC3)

#defineRCS2_1PORTC|=BIT(PORTC0)

#defineCCS1_1PORTC|=BIT(PORTC1)

#defineCCS2_1PORTC|=BIT(PORTC2)

#defineRCS1_0PORTC&=~BIT(PORTC3)

#defineRCS2_0PORTC&=~BIT(PORTC0)

#defineCCS1_0PORTC&=~BIT(PORTC1)

#defineCCS2_0PORTC&=~BIT(PORTC2)

#defineDOTLEDPORTPORTA

unsignedintRollCount=0;

unsignedintSecondCount=0;

unsignedcharSecondFlag=0;

constunsignedcharDOTLEDBIT[]={

                                0xfe,0xfd,0xfb,0xf7,

        0xef,0xdf,0xbf,0x7f,

        };

unsignedcharScanDOTLEDCount=0;

unsignedcharDOTLEDBuffer[32];

#pragmainterrupt_handlertimer1_ovf_isr:

7

voidtimer1_ovf_isr(void)

{

 TCNT1H=0xFE;

 TCNT1L=0x0C;

 

 //点阵LED扫描过程

 if(ScanDOTLEDCount<8)

   {

  DOTLEDPORT=DOTLEDBIT[ScanDOTLEDCount%8];

  CCS1_1;  

  CCS1_0;

  DOTLEDPORT=0xff;

  CCS2_1;  

  CCS2_0;

 }

 else

  {

    DOTLEDPORT=0xff;

    CCS1_1;  

  CCS1_0;

  DOTLEDPORT=DOTLEDBIT[ScanDOTLEDCount%8];

  CCS2_1;  

  CCS2_0;   

  }

 DOTLEDPORT=DOTLEDBuffer[ScanDOTLEDCount*2+1]; //下半屏的数据

 RCS2_1; 

 RCS2_0;

 DOTLEDPORT=DOTLEDBuffer[ScanDOTLEDCount*2];   //上半屏的数据

 RCS1_1; 

 RCS1_0; 

  

 ScanDOTLEDCount++;

 if(ScanDOTLEDCount==16)ScanDOTLEDCount=0; 

 //********************************************

 

 SecondCount++;

 if(SecondCount==100)

   {

  SecondCount=0;

  SecondFlag=1;

 } 

}

 

voidmain(void)

{

 unsignedinti;

   

 CLI();

 

 PORTA=0xFF;

 DDRA =0xFF;

 PORTC=0x00;

 DDRC =0x0F;

 TCCR1B=0x00;

 TCNT1H=0xFE;

 TCNT1L=0x0C;

 TCCR1A=0x00;

 TCCR1B=0x02;

 MCUCR=0x00;

 EMCUCR=0x00;

 GICR=0x00;

 TIMSK=0x80;

 

 SEI();

 

 for(i=0;i

 

 while

(1)

   {

  if(SecondFlag==1)

    {

   SecondFlag=0;

    for(i=0;i<(sizeof(DOTLEDBuffer)-2)/2;i++)

        {

    DOTLEDBuffer[2*i]=DOTLEDBuffer[2*i+2];

     DOTLEDBuffer[2*i+1]=DOTLEDBuffer[2*i+3];

     }

      DOTLEDBuffer[sizeof(DOTLEDBuffer)-2]=HZ[RollCount*2];

      DOTLEDBuffer[sizeof(DOTLEDBuffer)-1]=HZ[RollCount*2+1];

      RollCount++;

      if(RollCount==sizeof(HZ)/2)RollCount=0;   

  }

 }

}

=============

constunsignedcharHZ[]=

{

//;当前所选字体下一个汉字对应的点阵为:

 宽度x高度=1184x16, 调整后为:

1184x16

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,

0x14,0x20,0x24,0x10,0x44,0x4C,0x84,0x43,0x64,0x43,0x1C,0x2C,0x20,0x20,0x18,0x10,

0x0F,0x0C,0xE8,0x03,0x08,0x06,0x08,0x18,0x28,0x30,0x18,0x60,0x08,0x20,0x00,0x00,

0x40,0x40,0x41,0x20,0xCE,0x1F,0x04,0x20,0x00,0x40,0xFC,0x47,0x04,0x42,0x02,0x41,

0x02,0x40,0xFC,0x5F,0x04,0x40,0x04,0x42,0x04,0x44,0xFC,0x43,0x00,0x40,0x00,0x00,

0x40,0x00,0x20,0x00,0xF0,0x7F,0x1C,0x00,0x07,0x40,0xF2,0x41,0x94,0x22,0x94,0x14,

0x94,0x0C,0xFF,0x13,0x94,0x10,0x94,0x30,0x94,0x20,0xF4,0x61,0x04,0x20,0x00,0x00,

0x00,0x80,0x00,0x40,0x00,0x30,0xFE,0x0F,0x22,0x02,0x22,0x02,0x22,0x02,0x22,0x02,

0xFE,0xFF,0x22,0x02,0x22,0x02,0x22,0x42,0x22,0x82,0xFE,0x7F,0x00,0x00,0x00,0x00,

0x00,0x00,0x70,0x38,0x88,0x20,0x08,0x21,0x08,0x21,0x08,0x22,0x38,0x1C,0x00,0x00,

0x08,0x20,0xF8,0x3F,0x08,0x21,0x08,0x01,0x08,0x01,0x08,0x01,0xF0,0x00,0x00,0x00,

0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,

0x00,0x00,0xE0,0x0F,0x10,0x10,0x08,0x20,0x08,0x20,0x10,0x10,0xE0,0x0F,0x00,0x00,

0x00,0x00,0xE0,0x0F,0x10,0x11,0x88,0x20,0x88,0x20,0x18,0x11,0x00,0x0E,0x00,0x00,

0x00,0x00,0xE0,0x0F,0x10,0x10,0x08,0x20,0x08,0x20,0x10,0x10,0xE0,0x0F,0x00,0x00,

0x00,0x00,0x70,0x30,0x08,0x28,0x08,0x24,0x08,0x22,0x88,0x21,0x70,0x30,0x00,0x00,

0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,

0x00,0x20,0x00,0x3C,0xC0,0x23,0x38,0x02,0xE0,0x02,0x00,0x27,0x00,0x38,0x00,0x20,

0x08,0x00,0x78,0x00,0x88,0x07,0x00,0x38,0x00,0x0E,0xC8,0x01,0x38,0x00,0x08,0x00,

0x08,0x20,0xF8,0x3F,0x88,0x20,0x88,0x00,0x88,0x03,0x88,0x0C,0x70,0x30,0x00,0x20,

0x00,0x08,0x00,0x08,0xF8,0x0B,0x28,0x09,0x29,0x09,0x2E,0x09,0x2A,0x09,0xF8,0xFF,

0x28,0x09,0x2C,0x09,0x2B,0x09,0x2A,0x09,0xF8,0x0B,0x00,0x08,0x00,0x08,0x00,0x00,

0x00,0x80,0x00,0x40,0x00,0x30,0xFE,0x0F,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x01,

0x10,0x01,0x1F,0x01,0x10,0x01,0x10,0xFF,0x10,0x00,0x18,0x00,0x10,0x00,0x00,0x00,

0x08,0x04,0x08,0x03,0xC8,0x00,0xFF,0xFF,0x48,0x00,0x88,0x41,0x08,0x30,0x00,0x0C,

0xFE,0x03,0x02,0x00,0x02,0x00,0x02,0x00,0xFE,0x3F,0x00,0x40,0x00,0x78,0x00,0x00,

0x20,0x22,0x30,0x23,0xA8,0x22,0x67,0x12,0x32,0x12,0x00,0x20,0x0C,0x11,0x24,0x0D,

0x24,0x41,0x25,0x81,0x26,0x7F,0x24,0x01,0x24,0x05,0x24,0x09,0x0C,0x31,0x00,0x00,

0x40,0x00,0x40,0x00,0x20,0x00,0x50,0x7E,0x48,0x22,0x44,0x22,0x42,0x22,0x41,0x22,

0x42,0x22,0x44,0x22,0x68,0x22,0x50,0x7E,0x30,0x00,0x60,0x00,0x20,0x00,0x00,0x00,

0x40,0x00,0x42,0x40,0x42,0x20,0x42,0x10,0x42,0x0C,0xFE,0x03,0x42,0x00,0x42,0x00,

0x42,0x00,0x42,0x00,0xFE,0x7F,0x42,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x00,0x00,

0x00,0x40,0x10,0x20,0x3E,0x10,0x10,0x88,0x10,0x87,0xF0,0x41,0x9F,0x46,0x90,0x28,

0x90,0x10,0x92,0x28,0x94,0x27,0x1C,0x40,0x10,0xC0,0x10,0x40,0x10,0x00,0x00,0x00,

0x10,0x04,0x10,0x03,0xD0,0x00,0xFF,0x7F,0x50,0x00,0x90,0x11,0x00,0x0E,0xFE,0x41,

0x62,0x20,0xA2,0x11,0x22,0x0A,0x21,0x0E,0xA1,0x31,0x61,0x60,0x00,0x20,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x02,0x08,0xFE,0x1F,0x92,0x08,0x92,0x08,0x92,0x04,0xFE,0xFF,0x12,0x05,0x11,0x81,

0x12,0x41,0x1C,0x31,0xF0,0x0F,0x18,0x11,0x17,0x21,0x12,0xC1,0x10,0x41,0x00,0x00,

0x00,0x00,0x00,0x40,0x02,0x21,0x22,0x13,0xB2,0x09,0xAA,0x05,0x66,0x41,0x62,0x81,

0x22,0x7F,0x11,0x01,0x4D,0x05,0x81,0x09,0x01,0x13,0x01,0x62,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0xF8,0x0F,0x48,0x04,0x48,0x04,0x48,0x04,0x48,0x04,0xFF,0x3F,

0x48,0x44,0x48,0x44,0x48,0x44,0x48,0x44,0xF8,0x4F,0x00,0x40,0x00,0x70,0x00,0x00,

0x40,0x00,0x41,0x00,0x4E,0x00,0xC4,0x7F,0x00,0x20,0x20,0x10,0x24,0x00,0x24,0x7E,

0x24,0x22,0x24,0x22,0xFC,0x23,0x22,0x22,0x22,0x22,0x22,0x7E,0x20,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x36,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,0x10,0x20,0x10,0x20,0xF8,0x3F,0x00,0x20,0x00,0x20,0x00,0x00,0x00,0x00,

0x00,0x00,0x30,0x18,0x08,0x20,0x88,0x20,0x88,0x20,0x48,0x11,0x30,0x0E,0x00,0x00,

0x00,0x00,0x38,0x00,0x08,0x00,0x08,0x3F,0xC8,0x00,0x38,0x00,0x08,0x00,0x00,0x00,

0x00,0x00,0xE0,0x0F,0x10,0x11,0x88,0x20,0x88,0x20,0x18,0x11,0x00,0x0E,0x00,0x00,

0x00,0x00,0x70,0x1C,0x88,0x22,0x08,0x21,0x08,0x21,0x88,0x22,0x70,0x1C,0x00,0x00,

0x00,0x00,0x38,0x00,0x08,0x00,0x08,0x3F,0xC8,0x00,0x38,0x00,0x08,0x00,0x00,0x00,

0x00,0x00,0x00,0x07,0xC0,0x04,0x20,0x24,0x10,0x24,0xF8,0x3F,0x00,0x24,0x00,0x00,

0x00,0x00,0x70,0x1C,0x88,0x22,0x08,0x21,0x08,0x21,0x88,0x22,0x70,0x1C,0x00,0x00,

0x00,0x00,0x70,0x1C,0x88,0x22,0x08,0x21,0x08,0x21,0x88,0x22,0x70,0x1C,0x00,0x00,

0x00,0x00,0x38,0x00,0x08,0x00,0x08,0x3F,0xC8,0x00,0x38,0x00,0x08,0x00,0x00,0x00,

0x00,0x00,0xE0,0x0F,0x10,0x11,0x88,0x20,0x88,0x20,0x18,0x11,0x00,0x0E,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x5B,0x00,0x3B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x02,0x08,0xFE,0x1F,0x92,0x08,0x92,0x08,0x92,0x04,0xFE,0xFF,0x12,0x05,0x11,0x81,

0x12,0x41,0x1C,0x31,0xF0,0x0F,0x18,0x11,0x17,0x21,0x12,0xC1,0x10,0x41,0x00,0x00,

0x00,0x00,0x00,0x40,0x02,0x21,0x22,0x13,0xB2,0x09,0xAA,0x05,0x66,0x41,0x62,0x81,

0x22,0x7F,0x11,0x01,0x4D,0x05,0x81,0x09,0x01,0x13,0x01,0x62,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x40,0x00,0x20,0x00,0x10,0x00,0x0C,0x00,0x03,0xC0,0x00,0x3F,0x00,

0xC2,0x01,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0x20,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x36,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,0x02,0x02,0x21,0x82,0x40,0xF2,0x3F,0x4A,0x00,0x46,0x04,0x02,0x03,0xE0,0x00,

0x40,0x20,0x00,0x40,0xFF,0x3F,0x00,0x00,0x20,0x00,0xC0,0x00,0x00,0x07,0x00,0x00,

0x00,0x00,0x80,0x80,0xE0,0x40,0x9E,0x20,0x88,0x18,0x88,0x07,0x88,0x00,0xFF,0x00,

0x88,0x00,0x88,0x3F,0x88,0x40,0x88,0x40,0x88,0x40,0x80,0x40,0x00,0x70,0x00,0x00,

0x00,0x01,0x80,0x40,0x60,0x40,0x1E,0x41,0x10,0x41,0x10,0x41,0x10,0x41,0x10,0x41,

0xFF,0x7F,0x12,0x41,0x10,0x41,0x10,0x41,0x98,0x41,0x10,0x61,0x00,0x40,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x02,0x00,0xF2,0x7F,0x12,0x28,0x12,0x24,0x12,0x22,0xFE,0x21,0x12,0x20,0x12,0x20,

0x12,0x20,0xFE,0x21,0x12,0x22,0x12,0x22,0x12,0x22,0xF2,0x7F,0x02,0x00,0x00,0x00,

0x40,0x00,0x42,0x00,0xDC,0x7F,0x08,0x20,0x44,0x10,0x54,0x00,0x65,0xFF,0x7E,0x49,

0x44,0x49,0x44,0x49,0x44,0x49,0x7E,0x49,0x65,0xFF,0x54,0x00,0x44,0x00,0x00,0x00,

0x00,0x08,0x00,0x08,0xF8,0x0B,0x28,0x09,0x29,0x09,0x2E,0x09,0x2A,0x09,0xF8,0xFF,

0x28,0x09,0x2C,0x09,0x2B,0x09,0x2A,0x09,0xF8,0x0B,0x00,0x08,0x00,0x08,0x00,0x00,

0x00,0x80,0x00,0x40,0x00,0x30,0xFE,0x0F,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x01,

0x10,0x01,0x1F,0x01,0x10,0x01,0x10,0xFF,0x10,0x00,0x18,0x00,0x10,0x00,0x00,0x00,

0x08,0x04,0x08,0x03,0xC8,0x00,0xFF,0xFF,0x48,0x00,0x88,0x41,0x08,0x30,0x00,0x0C,

0xFE,0x03,0x02,0x00,0x02,0x00,0x02,0x00,0xFE,0x3F,0x00,0x40,0x00,0x78,0x00,0x00,

0x00,0x00,0x00,0x00,0xF8,0x0F,0x48,0x04,0x48,0x04,0x48,0x04,0x48,0x04,0xFF,0x3F,

0x48,0x44,0x48,0x44,0x48,0x44,0x48,0x44,0xF8,0x4F,0x00,0x40,0x00,0x70,0x00,0x00,

0x00,0x01,0x00,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x41,0x02,0x81,0xE2,0x7F,

0x12,0x01,0x0A,0x01,0x06,0x01,0x02,0x01,0x00,0x01,0x80,0x01,0x

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 法律文书 > 辩护词

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1