找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3371|回复: 0
收起左侧

16X16点阵式电子显示屏仿真程序

[复制链接]
ID:205560 发表于 2017-5-28 10:20 | 显示全部楼层 |阅读模式
232959yq6ayrn00bv5rwny.png
  1. #include<reg51.h>
  2. #define uchar unsigned char
  3. #define unit unsighed int
  4. #define out0 P0
  5. #define out2 P2
  6. #define out2 P1
  7. void delay(unit j)
  8. {
  9. uchar i=250;
  10. for(;j>0;j--)
  11. {
  12. while(--i);
  13. i=100;
  14. }

  15. }
  16. uchar code string[]={
  17. //汉字“东”的16*16点阵的列码
  18. 0x00,0x08,0x88,0x48,0x28,0x18,0x0F,0xE8,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,
  19. 0x00,0x20,0x11,0x09,0x05,0x41,0x81,0x7F,0x01,0x01,0x05,0x09,0x11,0x20,0x00,0x00
  20. //汉字“哥”的16*16点阵的列码
  21. 0x00,0x02,0x02,0x7A,0x4A,0x4A,0x4A,0x4A,0x7A,0x02,0x02,0x7E,0x02,0x02,0x00,0x00,
  22. 0x01,0x01,0x01,0x3D,0x25,0x25,0x25,0x25,0x3D,0x41,0x81,0x7F,0x01,0x01,0x01,0x00
  23. //汉字“东”的16*16点阵的列码
  24. 0x00,0x08,0x88,0x48,0x28,0x18,0x0F,0xE8,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,
  25. 0x00,0x20,0x11,0x09,0x05,0x41,0x81,0x7F,0x01,0x01,0x05,0x09,0x11,0x20,0x00,0x00
  26. //汉字“哥”的16*16点阵的列码
  27. 0x00,0x02,0x02,0x7A,0x4A,0x4A,0x4A,0x4A,0x7A,0x02,0x02,0x7E,0x02,0x02,0x00,0x00,
  28. 0x01,0x01,0x01,0x3D,0x25,0x25,0x25,0x25,0x3D,0x41,0x81,0x7F,0x01,0x01,0x01,0x00
  29. }   
  30. void main()
  31. {
  32. uchar i,j,n;
  33. while(1)
  34. {
  35. for(j=0;j<4;j++)
  36. {
  37. for(n=0;n<40;n++)
  38. {
  39. for(i=0;n<16;i++)
  40. {
  41. out1=i%16;
  42. put0=string[i*2+j*32];
  43. out2=string[i*2+1+j*32];
  44. delay(4);
  45. out0=0xff;
  46. out2=0xff;
  47. }
  48. }
  49. }
  50. }


复制代码


回复

使用道具 举报

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

本版积分规则

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

Powered by 单片机教程网

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