Arduino控制12864字符液晶案例_第1页
Arduino控制12864字符液晶案例_第2页
Arduino控制12864字符液晶案例_第3页
Arduino控制12864字符液晶案例_第4页
Arduino控制12864字符液晶案例_第5页
已阅读5页,还剩17页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、业界约定俗成的简称。主要控制芯片一般为ST7920或与之兼容的IC。大家在网上搜索12864时,总会发现带不带字库,它们的分别:带字库版不需要用点阵生成器把汉字变成点阵后再输入,直接输入汉字内码即可显示出对应汉字,无字库版想要显示汉字,只能自己按照点阵方式驱动。硬件特性:提供 8 位,4 位并行接口及串行接口可选并行接口适配 M6800 时序 自动电源启动复位功能内部自建振荡源6416 位字符显示 RAM(DDRAM 最多 16 字符4 行,LCD 显示范围 162 行)2M 位中文字型 ROM(CGROM),总共提供 8192 个中文字型(1616 点阵)16K 位半宽字型 ROM(HCGR

2、OM),总共提供 126 个西文字型(168 点阵)6416 位字符产生 RAM(CGRAM)引脚功能图:/* Arduino驱动LCD12864显示 BY YFRobot*/ #include LCD12864RSPI.h#define AR_SIZE( a ) sizeof( a ) / sizeof( a0 )unsigned char show0=YFROBOT; /YFROBOTunsigned char show1= 0xB9, 0xA4, 0xD7, 0xF7, 0xCA, 0xD2 ; /工作室unsigned char show2=Touch You Future; /Tou

3、ch You Futureunsigned char logo = / 扬帆Logo 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, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0

4、x00,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,0x00,0x00,0x00,0x00,0x00, 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x40,0x00,0x00,0x00,0x00

5、,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03, 0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x

6、07, 0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E, 0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C, 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C, 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00

7、,0x00,0x00,0x00,0x00,0x00,0x78, 0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70, 0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0, 0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xE0, 0x03,0xC0,0x00,0x00,0x

8、00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0, 0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0, 0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0, 0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x07,

9、0x80, 0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80, 0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00, 0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00, 0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x

10、00,0x00,0x00,0x00,0x00,0x1F,0x00, 0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00, 0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00, 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00, 0x00,0x80,0x00,0x00,

11、0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00, 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7

12、C,0x00, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00, 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x01, 0xC0,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x01, 0xC1,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,

13、0x00,0x00,0x00,0x00,0x00,0x78,0x01, 0xC7,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x01, 0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x04, 0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x1C, 0x20,0x00,0x00,0x0

14、0,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x7C, 0x14,0xCE,0xEE,0x6F,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00, 0x15,0x4A,0xA8,0xA5,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x0F, 0x09,0x4A,0xEE,0xA5,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0

15、x38,0x0C, 0x08,0xEA,0x28,0x75,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18, 0x08,0x00,0xE8,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x20, 0x00,0x0F,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00, 0x0F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, 0x0

16、0,0x00,0x00,0x00,0x00,0x00,0x00,0x1F, 0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF, 0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF, 0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF, 0x00,0x00,0x00,0

17、x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF8, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80, 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

18、,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,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, 0

19、x00,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,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

20、,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,0x00,0x00,0x00,0x00,0x00; void setup() LCDA.Initialise(); / 屏幕初始化 delay(100);void LOGO() LCDA.CLEAR();/清屏 delay(100); LCDA.DrawFullScre

21、en(logo); /全屏显示logovoid NAME() LCDA.CLEAR();/清屏 delay(100); LCDA.DisplayString(0,0,show0,AR_SIZE(show0);/第一行第一格开始,显示YFROBOT delay(100); LCDA.DisplayString(0,4,show1,AR_SIZE(show1);/第一行第五个字开始,显示文字工作室 delay(100); LCDA.DisplayString(2,0,show2,AR_SIZE(show2);/第三行第一格开始,显示Touch You Future void loop() LOGO

22、(); delay(3000); NAME(); delay(3000);上面的效果图如何获得的呢?首先英文字母不需要麻烦,直接输出就可以;然后介绍下如何获取汉字内码,我们打开汉字内码获取工具(由ardyPro所写,很好用;本帖也有下载链接),然后输入想要显示的汉字,例如:“工作室”;点击转换,转换结果就会出现内码了,如下图,其中“0xB9, 0xA4,”就是“共”字的内码,将其复制到程序中就可以使用了汉字一个字占两个字符,相当于两个英文字母的大小,所以我们程序中LCDA.DisplayString(0,4,show1,AR_SIZE(show1);/第一行第五个字开始,显示文字工作室的语句是从第五个字开始显示,因为“YFROBOT”占用了7个字符,就相当于占用了4个汉字的位置!下面我来介绍下图片是如何获取的,你需要个图片取模工具(本帖最后有下载链接),打开它,然后找到你想要显示的图片,这里我就以上面程序中的图片为例了!图片如下:然后我们通过PS软件打开它;再在PS中新建一个128*64的空白图片:然后我们将我们的图片经过一些处理:将其尺寸改小,能拖到128*64的空

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论