找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6976|回复: 7
收起左侧

我制作的led胸牌 含原理图 源代码及proteus仿真

[复制链接]
ID:173141 发表于 2017-5-12 16:10 | 显示全部楼层 |阅读模式
程序简单,适合初学者,内附原理图代码等,用proteus8制作,用16*16点阵显示汉字。

proteus8仿真原理图:
51hei.png
0.png 0.png

单片机源程序如下:
  1. #include<reg51.h>
  2. #include<stdlib.h>
  3. #define  uchar unsigned char
  4. #define  uint unsigned int
  5. uchar code col[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};//列控制数组
  6. uchar code row[][32]={                                                           //字模

  7. {0x40,0x00,0x80,0x00,0xFE,0x7F,0x02,0x40,0x81,0x20,0x80,0x00,0x80,0x00,0xFE,0x3F,
  8. 0xC0,0x01,0xA0,0x02,0x90,0x04,0x88,0x08,0x84,0x10,0x83,0x60,0x80,0x00,0x80,0x00},/*"宋",0*/

  9. {0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0xFF,0x7F,0x80,0x00,
  10. 0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0xFC,0x1F,0x00,0x00},/*"士",0*/      

  11. {0x20,0x04,0x20,0x08,0x20,0x08,0x20,0x00,0xFF,0x7F,0x20,0x01,0x20,0x11,0x20,0x11,
  12. 0x20,0x09,0x10,0x05,0x10,0x03,0x08,0x41,0x88,0x41,0x44,0x41,0x22,0x7E,0x01,0x00},/*"龙",0*/

  13. {0x20,0x00,0x70,0x00,0x1E,0x00,0x10,0x3E,0x10,0x22,0xFF,0x22,0x10,0x22,0x18,0x22,
  14. 0x38,0x22,0x54,0x22,0x54,0x22,0x12,0x22,0x11,0x3E,0x10,0x22,0x10,0x00,0x10,0x00},/*"和",0*/

  15. {0x08,0x00,0x10,0x3E,0xFF,0x22,0x00,0x12,0x7E,0x12,0x42,0x0A,0x7E,0x12,0x00,0x12,
  16. 0x7E,0x22,0x20,0x22,0x10,0x22,0xF0,0x16,0x1F,0x0A,0x10,0x02,0x14,0x02,0x08,0x02},/*"郭",0*/

  17. {0x08,0x02,0x08,0x02,0xFC,0x7E,0x14,0x09,0xA2,0x10,0x01,0x0F,0xFC,0x00,0x80,0x00,
  18. 0x80,0x00,0xFF,0x7F,0x80,0x00,0x40,0x01,0x20,0x02,0x10,0x04,0x0C,0x18,0x03,0x60},/*"笑",0*/

  19. {0x08,0x02,0x08,0x02,0xFC,0x7E,0x14,0x09,0xA2,0x10,0x01,0x0F,0xFC,0x00,0x80,0x00,
  20. 0x80,0x00,0xFF,0x7F,0x80,0x00,0x40,0x01,0x20,0x02,0x10,0x04,0x0C,0x18,0x03,0x60},/*"笑",0*/

  21. {0x20,0x20,0x24,0x20,0x24,0x20,0xFC,0x25,0x22,0x24,0x20,0x24,0xFF,0x27,0x20,0x24,
  22. 0x20,0x24,0xFC,0x25,0x24,0x25,0x24,0x25,0x64,0x21,0xA4,0x20,0x20,0x28,0x20,0x10},/*"制",0*/

  23. {0x90,0x00,0x90,0x00,0x90,0x00,0x88,0x7F,0x48,0x01,0x4C,0x01,0x2C,0x01,0x0A,0x1F,
  24. 0x09,0x01,0x08,0x01,0x08,0x01,0x08,0x3F,0x08,0x01,0x08,0x01,0x08,0x01,0x08,0x01},/*"作",0*/

  25. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  26. 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x08,0x00,0x04,0x00,0x00,0x00},/*",",0*/

  27. {0x80,0x10,0x42,0x10,0xE4,0x11,0x24,0x11,0xE0,0x7D,0x20,0x11,0xE7,0x11,0x24,0x13,
  28. 0x24,0x15,0xF4,0x15,0x84,0x11,0x54,0x11,0x2C,0x11,0x14,0x11,0x40,0x15,0x80,0x08},/*"谢",0*/

  29. {0x80,0x10,0x42,0x10,0xE4,0x11,0x24,0x11,0xE0,0x7D,0x20,0x11,0xE7,0x11,0x24,0x13,
  30. 0x24,0x15,0xF4,0x15,0x84,0x11,0x54,0x11,0x2C,0x11,0x14,0x11,0x40,0x15,0x80,0x08},/*"谢",0*/

  31. {0x00,0x00,0x80,0x3F,0x80,0x20,0xBF,0x20,0xA0,0x24,0xA0,0x24,0x92,0x24,0x94,0x24,
  32. 0x88,0x24,0x88,0x2A,0x14,0x0A,0x24,0x09,0x22,0x09,0x81,0x48,0x40,0x48,0x20,0x70},/*"观",0*/

  33. {0x00,0x1F,0xFE,0x00,0x80,0x00,0xFC,0x1F,0x40,0x00,0xFF,0x7F,0x20,0x00,0x10,0x00 ,
  34. 0xF8,0x0F,0x14,0x08,0xF2,0x0F,0x11,0x08,0xF0,0x0F,0x10,0x08,0xF0,0x0F,0x10,0x08},/*"看",0*/

  35. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  36. 0x00,0x00,0x00,0x00,0x18,0x00,0x24,0x00,0x24,0x00,0x18,0x00,0x00,0x00,0x00,0x00},/*"。",0*/
  37. };
  38.          
  39. void delayms(uint t) //延时函数                          
  40. {
  41.      uint x,y;
  42.      for(x=t;x>0;x--)
  43.          for(y=124;y>0;y--);
  44. }                                                

  45. void display(uint n) //显示函数         
  46. {
  47.      uint i,j;
  48.      for(j=0;j<12;j++)   
  49.      for(i=0;i<16;i++)
  50.          {
  51.                          P2=col[i];               
  52.              P0=row[n][2*i];
  53.              P1=row[n][2*i+1];
  54.              delayms(3);                                   
  55.          }                                   
  56. }                        

  57. void main() //主函数
  58. {
  59. P3=0;
  60. while(1)         
  61. {
  62.         P3=0;if(P3!=0){display(0);delayms(50);}else   break;  
  63.         P3=0;if(P3!=0){display(1);delayms(50);}else   break;
  64.         P3=0;if(P3!=0){display(2);delayms(50);}else   break;
  65.         P3=0;if(P3!=0){display(3);delayms(50);}else   break;
  66.         P3=0;if(P3!=0){display(4);delayms(50);}else   break;
  67.         P3=0;if(P3!=0){display(5);delayms(50);}else   break;
  68.         P3=0;if(P3!=0){display(6);delayms(50);}else   break;
  69. ……………………

  70. …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码

所有资料51hei提供下载:
led胸牌.rar (22.27 KB, 下载次数: 78)
回复

使用道具 举报

ID:827657 发表于 2020-11-10 09:48 | 显示全部楼层
好东西!这个可以改一下里面的字吗?谢谢,看到请回复一下
回复

使用道具 举报

ID:795788 发表于 2020-11-10 11:15 来自手机 | 显示全部楼层
最爱Pcy 发表于 2020-11-10 09:48
好东西!这个可以改一下里面的字吗?谢谢,看到请回复一下

这个可以的,把你想要的字转换成字模,然后添加进去就好了
回复

使用道具 举报

ID:892411 发表于 2021-3-17 11:17 来自手机 | 显示全部楼层
这仿真需要用Proteus8.8才能打开.
51hei.png
回复

使用道具 举报

ID:748788 发表于 2021-3-20 16:56 | 显示全部楼层
练手是可以,不过xb上的同类产品真的很便宜,5块钱就能买到,还包邮
ClipBoard.jpg

回复

使用道具 举报

ID:894868 发表于 2021-3-22 09:29 | 显示全部楼层
这个学习不错··TB不过产品都挺多,而且价格很便宜··
回复

使用道具 举报

ID:927615 发表于 2021-6-22 15:24 来自手机 | 显示全部楼层
仿真怎么才能工作起来?
回复

使用道具 举报

ID:927615 发表于 2021-6-25 17:39 来自手机 | 显示全部楼层
如何向左移动起来
回复

使用道具 举报

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

本版积分规则

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

Powered by 单片机教程网

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