找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3385|回复: 3
收起左侧

公交车滚动led点阵显示屏 仿真图+原代码

[复制链接]
ID:124161 发表于 2016-6-4 19:07 | 显示全部楼层 |阅读模式
本帖最后由 happy112 于 2016-6-4 19:09 编辑

仿真原理图:
0.png
原代码:
  1. #include <reg52.h>

  2. #define int8 unsigned char
  3. #define int16 unsigned int
  4. #define int32 unsigned long

  5. int8 flag;
  6. int8 n;
  7. int8 code table[][32]={
  8.                           {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},/* "  " */


  9.                           {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*/
  10.                           {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*/
  11.                           {0x00,0x01,0x04,0x02,0x1C,0x0C,0xC0,0x3F,0x1C,0xC0,0x02,0x09,0x02,0x16,0x92,0x60,0x4A,0x20,0x82,0x2F,0x02,0x20,0x0E,0x24,0x00,0x22,0x90,0x31,0x0C,0x20,0x00,0x00},/*"您",2*/
  12.                           {0x44,0x10,0x44,0x14,0x88,0x54,0x88,0x54,0xD0,0x5F,0x30,0x50,0x60,0x50,0xFE,0x7F,0x40,0x50,0x20,0x90,0xB0,0x9F,0x98,0x92,0x8C,0x94,0x88,0x34,0x80,0x11,0x00,0x00},/*"乘",3*/
  13.                           {0x82,0x00,0x02,0x01,0x22,0x06,0x22,0x38,0x22,0x04,0x22,0x03,0x22,0x00,0xFE,0xFF,0xA2,0x00,0x22,0x01,0x22,0x02,0x22,0x3C,0x22,0x02,0x02,0x01,0x02,0x00,0x00,0x00},/*"坐",4*/
  14.                           {0x02,0x00,0x0C,0x00,0xF0,0x3F,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0xA0,0x00,0x60,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x00},/*"广",5*/
  15.                           {0x80,0x00,0x01,0x07,0x06,0x00,0x18,0x00,0xE0,0xFF,0x00,0x04,0x00,0x03,0x00,0x00,0xFE,0x7F,0x00,0x08,0x00,0x06,0x80,0x01,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00},/*"州",6*/
  16.                           {0x00,0x00,0x04,0x20,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x20,0x04,0x00,0x00,0x00},/*"三",7*/
  17.                           {0x20,0x08,0x20,0x86,0x7F,0x60,0x80,0x0F,0x00,0x04,0x00,0x1A,0x00,0xEA,0x00,0x2A,0x00,0x2A,0x00,0x2A,0x00,0x2A,0xF0,0x2B,0x0C,0x28,0x02,0x20,0x0F,0x00,0x00,0x00},/*"汽",8*/
  18.                           {0x00,0x00,0x80,0x00,0x04,0x01,0x0E,0x02,0x14,0x0C,0x24,0x70,0xC4,0x21,0x8C,0x00,0x08,0x00,0x08,0x70,0x28,0x08,0x1E,0x06,0x0C,0x03,0x80,0x01,0x00,0x01,0x00,0x00},/*"公",9*/
  19.                           {0x00,0x00,0x00,0x08,0xF8,0x49,0x20,0x49,0x20,0x49,0x20,0x49,0x20,0x49,0x20,0x49,0x20,0x49,0xF0,0x49,0x00,0x48,0x04,0x40,0x02,0x40,0xFC,0x7F,0x00,0x00,0x00,0x00},/*"司",10*/
  20.                           {0x00,0x00,0x80,0x00,0x04,0x01,0x0E,0x02,0x14,0x0C,0x24,0x70,0xC4,0x21,0x8C,0x00,0x08,0x00,0x08,0x70,0x28,0x08,0x1E,0x06,0x0C,0x03,0x80,0x01,0x00,0x01,0x00,0x00},/*"公",11*/
  21.                           {0x40,0x00,0x40,0x08,0x41,0x08,0x42,0x08,0x4C,0x08,0xF8,0x7F,0x50,0x08,0x40,0x08,0x40,0x08,0x60,0x08,0xD0,0x7F,0x4C,0x08,0x47,0x08,0x42,0x08,0x40,0x00,0x00,0x00},/*"共",12*/
  22.                           {0x20,0x08,0x20,0x86,0x7F,0x60,0x80,0x0F,0x00,0x04,0x00,0x1A,0x00,0xEA,0x00,0x2A,0x00,0x2A,0x00,0x2A,0x00,0x2A,0xF0,0x2B,0x0C,0x28,0x02,0x20,0x0F,0x00,0x00,0x00},/*"汽",13*/
  23.                           {0x20,0x00,0x20,0x20,0x20,0x21,0x20,0x23,0x20,0x25,0x20,0x39,0x20,0xE1,0x20,0x21,0xFF,0x2F,0x20,0x21,0x20,0x21,0x20,0x21,0x20,0x21,0x20,0x21,0x20,0x00,0x00,0x00},/*"车",14*/
  24.                           {0x00,0x00,0x00,0x00,0x1A,0x00,0x1C,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},/*",",15*/
  25.                           {0x00,0x04,0x01,0x04,0x02,0x04,0x04,0x04,0x08,0x04,0x30,0x04,0xC0,0x05,0x00,0xFE,0x80,0x05,0x60,0x04,0x10,0x04,0x0C,0x04,0x06,0x04,0x03,0x04,0x02,0x04,0x00,0x00},/*"大",16*/
  26.                           {0x00,0x02,0x40,0x0C,0x40,0x08,0x40,0x48,0x40,0x3A,0x40,0x2A,0x42,0x0A,0x41,0x8A,0xFE,0x7A,0x40,0x2B,0x40,0x0A,0x40,0x18,0x40,0xEA,0x40,0x4C,0x40,0x08,0x00,0x00},/*"学",17*/
  27.                           {0x20,0x08,0x30,0x08,0xE0,0xFF,0x42,0x08,0x4C,0x08,0xF0,0x1F,0x10,0x12,0x1A,0x12,0xF2,0x13,0x04,0x10,0xC8,0xFF,0x30,0x10,0xCC,0x50,0x02,0x37,0x1C,0x12,0x00,0x00},/*"城",18*/
  28.                           {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x0E,0x14,0x10,0x24,0x10,0x44,0x10,0x84,0x11,0x0C,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"2",0*/
  29.                           {0x04,0x02,0x44,0x06,0xC4,0x1A,0x48,0xE3,0x48,0x46,0x48,0x00,0x04,0x09,0x04,0x09,0x08,0x09,0xC8,0xFF,0x30,0x09,0x28,0x49,0x44,0x39,0x02,0x29,0x1F,0x01,0x00,0x00},/*"线",19*/
  30.                           {0x00,0x02,0x02,0x42,0x04,0x42,0x08,0x42,0x30,0x42,0xC0,0x7F,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x42,0xFE,0x7F,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x00},/*"开",20*/
  31.                           {0x40,0x04,0x80,0x08,0x00,0x11,0xFF,0xEF,0x00,0x44,0x02,0x10,0x82,0x10,0x82,0x10,0x82,0x90,0xFE,0x7F,0x82,0x50,0x82,0x10,0x82,0x10,0x82,0x10,0x02,0x10,0x00,0x00},/*"往",21*/
  32.                           {0x00,0x04,0x01,0x04,0x02,0x04,0x04,0x04,0x08,0x04,0x30,0x04,0xC0,0x05,0x00,0xFE,0x80,0x05,0x60,0x04,0x10,0x04,0x0C,0x04,0x06,0x04,0x03,0x04,0x02,0x04,0x00,0x00},/*"大",22*/
  33.                           {0x00,0x02,0x40,0x0C,0x40,0x08,0x40,0x48,0x40,0x3A,0x40,0x2A,0x42,0x0A,0x41,0x8A,0xFE,0x7A,0x40,0x2B,0x40,0x0A,0x40,0x18,0x40,0xEA,0x40,0x4C,0x40,0x08,0x00,0x00},/*"学",23*/
  34.                           {0x20,0x08,0x30,0x08,0xE0,0xFF,0x42,0x08,0x4C,0x08,0xF0,0x1F,0x10,0x12,0x1A,0x12,0xF2,0x13,0x04,0x10,0xC8,0xFF,0x30,0x10,0xCC,0x50,0x02,0x37,0x1C,0x12,0x00,0x00},/*"城",24*/
  35.                           {0x00,0x00,0x00,0x00,0x1A,0x00,0x1C,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},/*",",25*/
  36.                           {0x00,0x02,0x00,0x42,0x00,0x32,0xFE,0x23,0x04,0x00,0x08,0x44,0xFF,0x55,0x50,0x55,0x50,0x55,0x50,0xFD,0x52,0x55,0x51,0x55,0xFE,0x55,0x00,0x44,0x00,0x04,0x00,0x00},/*"请",26*/
  37.                           {0x00,0x01,0x04,0x02,0x1C,0x0C,0xC0,0x3F,0x1C,0xC0,0x02,0x09,0x02,0x16,0x92,0x60,0x4A,0x20,0x82,0x2F,0x02,0x20,0x0E,0x24,0x00,0x22,0x90,0x31,0x0C,0x20,0x00,0x00},/*"您",27*/
  38.                           {0x82,0x00,0x02,0x01,0x22,0x06,0x22,0x38,0x22,0x04,0x22,0x03,0x22,0x00,0xFE,0xFF,0xA2,0x00,0x22,0x01,0x22,0x02,0x22,0x3C,0x22,0x02,0x02,0x01,0x02,0x00,0x00,0x00},/*"坐",28*/
  39.                           {0x01,0x08,0xC2,0x08,0x44,0x0F,0x28,0xF8,0x30,0x08,0xCE,0x0F,0x04,0x01,0x00,0x41,0x02,0x41,0x01,0x41,0xFE,0x4F,0x00,0x51,0x00,0x61,0x00,0x41,0x00,0x01,0x00,0x00},/*"好",29*/
  40.                           {0x42,0x08,0x81,0x08,0xFE,0xFF,0x00,0x09,0x01,0x0A,0x01,0x01,0x02,0x11,0x0C,0x11,0x30,0x11,0xC0,0xFF,0x30,0x11,0x08,0x11,0x06,0x11,0x03,0x11,0x02,0x01,0x00,0x00},/*"扶",30*/
  41.                           {0x20,0x08,0xC0,0x48,0x00,0x4B,0xFF,0x7F,0x00,0x89,0x9C,0x88,0x00,0x10,0xBC,0x2A,0x82,0xCA,0xC2,0x4A,0xB2,0x5A,0x82,0x6A,0xAE,0x0A,0x90,0x0F,0x0C,0x00,0x00,0x00},/*"稳",31*/
  42.                           {0x00,0x00,0x00,0x00,0x00,0x00,0xFA,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",32*/

  43.                           {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}/* "  " */
  44.                       };

  45. void delay(void);
  46. int16 offset;

  47. void main(void)
  48. {
  49.     int8 i;
  50.     int8 *p;
  51.     flag=0x10;
  52.     n=0;
  53.     TMOD=0x01;
  54.     TH0=0xb1;
  55.     TL0=0xe0;
  56.     ET0=1;
  57.     EA=1;
  58.     TR0=1;

  59.     p=&table[0][0];

  60.     while (1)
  61.     {
  62.         for (i=0;i<8;i++)    //显示左半边屏幕
  63.         {
  64.             P0=*(p+offset+2*i);
  65.             P2=i|0x08;    //P2.4=0,P2.3=1 选中U2, 输出扫描码给U6
  66.             delay();

  67.             P0=*(p+offset+2*i+1);
  68.               P2=i|0x10;   //P2.4=1,P2.3=0 选中U3, 输出扫描码给U7
  69.             delay();
  70.         }
  71.         for (i=8;i<16;i++)     //显示右半边屏幕
  72.         {
  73.             P0=*(p+offset+2*i);
  74.              P2=(i-8)|0x20;   //P2.5=1 P2.4=0, P2.3=0 选中U4,输出扫描码U8
  75.             delay();

  76.             P0=*(p+offset+2*i+1);
  77.              P2=(i-8)|0x40;   //P2.6=1 P2.5=0, P2.4=0 选中U5,输出扫描码U9
  78.             delay();
  79.         }
  80.     }
  81. }


  82. void delay(void)
  83. {
  84.     int16 i;
  85.     for (i=0;i<50;i++)
  86.         ;
  87. }


  88. void timer0() interrupt 1 using 3
  89. {
  90.     TF0=0;
  91.     TH0=0xb1;
  92.     TL0=0xe0;
  93.     if (n<10)
  94.     {
  95.     n++;
  96.     }
  97.     else
  98.     {
  99.     offset+=2;
  100.     if (offset>1100)
  101.             offset=0;
  102.         n=0;
  103.     }
  104. }




















复制代码
0.png
全部资料(压缩包)下载:
公交车滚动led点阵显示屏.rar (72.62 KB, 下载次数: 78)
回复

使用道具 举报

ID:106997 发表于 2016-6-7 20:32 | 显示全部楼层
换文字怎么取模,你的取模参数是怎样的?
回复

使用道具 举报

ID:132987 发表于 2016-7-19 18:22 | 显示全部楼层
同求啊000000000
回复

使用道具 举报

ID:199472 发表于 2017-5-24 21:29 | 显示全部楼层
IMMI0919 发表于 2016-6-7 20:32
换文字怎么取模,你的取模参数是怎样的?

字模精灵 可以取模
回复

使用道具 举报

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

本版积分规则

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

Powered by 单片机教程网

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