找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2887|回复: 2
收起左侧

ST7565 LCD12864显示图片

[复制链接]
ID:368523 发表于 2018-7-13 15:42 | 显示全部楼层 |阅读模式
显示图片效果图.JPG

  1. #include<reg51.h>
  2. #include"st7565.h"
  3. //---存一个图片--//
  4. unsigned char code pic[]={
  5. /*--  宽度x高度=128x64  --*/
  6. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,
  7. 0x57,0x53,0x57,0x07,0xFF,0x0F,0xE3,0x0F,0xEF,0xFF,0xEF,0xEF,0xEF,0x03,0xEF,0xEF,
  8. 0xEF,0x0F,0xE3,0x0F,0xEF,0xFF,0x77,0x77,0x17,0x57,0x57,0x53,0x57,0x57,0x17,0x77,
  9. 0x77,0xFF,0xFB,0x8B,0xAB,0x83,0xAB,0x83,0xAB,0x8B,0xFF,0x37,0xDB,0xFF,0xFF,0xFF,
  10. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,
  11. 0x57,0x53,0x57,0x07,0xFF,0x0F,0xE3,0x0F,0xEF,0xFF,0xEF,0xEF,0xEF,0x03,0xEF,0xEF,
  12. 0xEF,0x0F,0xE3,0x0F,0xEF,0xFF,0x77,0x77,0x17,0x57,0x57,0x53,0x57,0x57,0x17,0x77,
  13. 0x77,0xFF,0xFB,0x8B,0xAB,0x83,0xAB,0x83,0xAB,0x8B,0xFF,0x37,0xDB,0xFF,0xFF,0xFF,
  14. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEE,0xF5,
  15. 0xFB,0xF4,0xEF,0xE0,0xFF,0xF4,0xFB,0xF4,0xEF,0xFF,0xE0,0xEE,0xEE,0xEE,0xEE,0xE0,
  16. 0xFF,0xF4,0x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xFE,0xFC,0xF8,
  65. 0xF2,0xD2,0xE8,0xF7,0xF8,0xFF,0xDC,0xC8,0xC1,0xC3,0xC7,0xFF,0xFF,0xFF,0xFF,0xFF,
  66. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFC,0xF9,0xF3,0xF7,0xFB,0xFD,0xFE,0xFF,
  67. 0xFF,0xFF,0xFE,0xFC,0xF9,0xF3,0xF7,0xFB,0xFD,0xFE,0xFF,0xDF,0xDF,0xC1,0xC8,0xDC,
  68. 0xFF,0xF8,0xF7,0xEF,0xDF,0xF8,0xF2,0xF2,0xF8,0xFC,0xFE,0xFC,0xFC,0xFE,0xFC,0xF8,
  69. 0xF2,0xD2,0xE8,0xF7,0xF8,0xFF,0xDC,0xC8,0xC1,0xC3,0xC7,0xFF,0xFF,0xFF,0xFF,0xFF,
  70. };

  71. /*******************************************************************************
  72. * 函 数 名         : main
  73. * 函数功能                   : 主函数
  74. * 输    入         : 无
  75. * 输    出         : 无
  76. *******************************************************************************/

  77. void main(void)
  78. {
  79.         uchar i , j;
  80.         uint n;
  81.         Lcd12864_Init();        //初始化
  82.         Lcd12864_ClearScreen();        //清屏

  83.         for (i=0;i<8;i++)
  84.         {  
  85.             //--设置初始显示开始位置--//
  86.                 LcdSt7565_WriteCmd(0x40);

  87.                 //--设置Y坐标--//
  88.                 LcdSt7565_WriteCmd(0xB0+i);
  89.                
  90.                 //--设置X坐标--//
  91.                 LcdSt7565_WriteCmd(0x10);
  92.                 LcdSt7565_WriteCmd(0x04);
  93.                 for(j=0; j<128; j++)
  94.                 {
  95.                         LcdSt7565_WriteData(~pic[n]);
  96.                         n=n+1;
  97.                 }
  98.         }
  99.         while (1)
  100.         {
  101.         }
  102. }


复制代码


显示图片.rar

2.02 MB, 下载次数: 55, 下载积分: 黑币 -5

评分

参与人数 1黑币 +50 收起 理由
admin + 50 共享资料的黑币奖励!

查看全部评分

回复

使用道具 举报

ID:733461 发表于 2020-4-29 15:29 | 显示全部楼层
问下楼主,图片数据怎么做出来的,谢谢
回复

使用道具 举报

ID:231831 发表于 2020-4-30 15:03 | 显示全部楼层
我要二维码的,我要二维码的!!!
回复

使用道具 举报

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

本版积分规则

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

Powered by 单片机教程网

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