《LCD12864显示程序(成功版).docx》由会员分享,可在线阅读,更多相关《LCD12864显示程序(成功版).docx(14页珍藏版)》请在三一办公上搜索。
1、WicludeWincludedefineuitunsignedit#defineucharunsignedchar一定时运用的IO口WdefineDATA_P0RTPOSbit1.CD1286CS=P32;sbit1.CD1286RSET=P33;Sbit1.CD12864.RS=P26;SbitICD12864.RW=P27;sbit1.CD1286RD-P25;定义全同函数void1.CdSt7565_WriteCmd(Cmd);void1.cdSt7565.WriteData(dat);void1.cdl2864JnrM);void1.cdl2864-ClearScreen(void)
2、;void1.cdl2864_Writel6CnCHAR(ucharx,uchary.uchark);voidDelay10ms(unsignedintc);unsignedcharcodetable401132-文字:-V-宋体12;此字体下对应的点阵为:窕X高=16x16-/0x00,0x00,0x00,0x00,0x00,0x00z0x00z0x00z0x00,0x00,0x00,0x00,000i000,0x00f000,0x00,0x00,0x00,0x,0x,0xz0x00z0x00z0x00,0x00,0xl8,0x24.0x24,0xl8,0x,0x,八一文字:椰-7/一宋体1
3、2;此字体下对应的点阵为:宽X高=16x16-/0x00,0x06,0xDA,0x22,0x02r0xFEz0x20z0x26,0x28,0x34,0x24,0x7Fz0xA4,0x24z0x24z0x20z0xO0,Ox07.0x08.0xl0,0xO8,0xFFr0xr0xr0xFFz0x49z0x49z0x49,0x49,OFF,OxO2,OxO4,/一文字:第一/宋体12;此字体下对应的点阵为:宽Xr=16xl6T0x00,0x00,0x00,OxOOrOx7QOxS4,Ox54,Ox54,Ox54,0x55,0x56,Ox54rOx7CzOxOOzOxOO,OxOO,0x00,0x4
4、0,041,049r0x49r0x49z0x49z0x49z07F,049f049r0x49r0x49z0x49z0x40x40,文字;满-7F-宋体12;此字体下时应的点阵为:宽X高=16x16-*/0x00,024,024,02F,0E4z0x24z0x24,0E4z0x2F,0x24,0x24,0x,0x8Cz0x02,0x60,0x10,OxOO,Ox7F,Ox91zOx49zOxOOx09,Oxl9,Ox07,Ox09,0ll,0FROxOO,Ox01,07EfO04,Ox04,/-文字:柳T/*-宋体12;此字体下对应的点阵为:窕xl=16xl6-/OO0,0FC,0xO4,0O4
5、,OxFC,0xO0,0xF8,0x02,0x04,0xFC,OxlO,0x9O,0xFF,0xD0,Oxl0,Oxl0,0x00,0x07,0x08,0x04,OxFF,OxOO,OxOF,Ox32,Ox44,Ox8EOx01zOxOOzOxFxOO,Ox03,Ox04,/*-文字:烟T/-宋体12;此字体下对应的点阵为:,Xi=16xl6-/0xO0,0xFE,0x42,0x42z0x42z0xFA,0x42z0x42z0x42z0xFE,Ox08,Oxl0,0xFF,Ox,0x70,0x80z0x00,0xFF,0x40,0x4C,0x42,0x41,0x46,0x48,0x50,0xF
6、F,0xl0,0x08,0x07,0xl8,0x60,0x80,/-文字:胜T/*-宋体12;此字体下对应的点阵为:宽X高=16x16-/OxOO,Ox,OxlO.OxlO,OxlO,OxFF,OxlO,OxlO,Ox3C,Ox40,OxOO,OxFE,Ox22,Ox22,OxFE,OxOO,000,0x40,0x42,0x42,0x42,0x7F,042,0x42,0x42,0x40,0x,0xFF,0x82,0x02,0x7F.0x80,/*-文字:绝-Y/-宋体12;此字体下对应的点阵为:宽X高*16x16-/OxOO,OxOO,OxEO,Ox2C,Ox34,OxE4,Ox24,Ox27
7、,OxE8,OxlO,Ox20,OxlO,Ox63,OxAC,Ox30,Ox2D,0x00,0x70,0x43,0x42,0x42,0x43,0x42,0x42,0x3F,0x,0x00,0x12,0x12,0x22,0x67,0x22,/*-文字:,-T/-宋体12;此字体下对应的点阵为:xl=16xl6-/OxoOQXOo,0x00,0x00,0x00,0x00,0x00,0x00,0x0OQxoO,000,OxoO,0x00,0x00QXOO,0x00,0x00,0x,0x,0x00,0x,0x,0x,0x00,0x00,0x00,0x00,0x,0x38,0x58,0x,0x,/*-文
8、字:处-*/-宋体12;此字体下对应的点阵为:宽xi=16xl6-/0x00,0x,0x80,0x40,0x20,0xl0z0xFF,0x,0x,0xF8,0x08,0x08,0x9F,0x60,0x80,0x,0x00,0x40,0x41,0x40,0x4O,0x4Oz0x5F,0x40,Ox2O,Ox2O,Oxl3,0xOC,0xl3z0x20,0x40,0x81,/-文字:好T/-宋体12;此字体下时应的点阵为:宽X高=16x16-/OxOO,Ox80,Ox86.0x8A.Ox92,OxE2.0x82,Ox82,Ox80,Ox,OxFO,OxlO,OxlF,OxFO,OxlO,OxlOr
9、OxOO,Ox,Ox,OxOO,Ox,Ox7F,080,Ox40,OxOO,OxOO,Ox61,Oxl6,Ox08,0x15,0x22,0x40,/-文字:存-7/-宋体12;此字体下对应的点阵为:Xll三16xl6-/000,0x40,0x44,0x54,0x54,0xD4,0xS4,054,05F,0x74,0x54,0xD4,0x54,0x54,0x44,0x40,0x00,0x04,0x04,Ox02,0x01,0xF,0x92,092,092,Ox92,Ox92,OxFE,0x01,0x02,0O4,0O4,/-文字:年T/-宋体12;此字体下对应的点阵为:窕xl=16xl6-/0x
10、00,0x00,0x04,0x44,044,044,0x44,0xFC,0x44,044,044z0x44,0xC7,0xl8.0x20.0x00,0x00,0x04,0x(M,0x04,0xO4,0xO4,0xO4z0xFFz0xO4,0xO4,0xO4,0xO4,0xO7,Ox04,0x04,0x04,/*-文字:-一*/-宋体12;此字体下对应的点阵为:宽xi=16xl6-70x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x,0x,0x00,0x,0x,0x,0x0
11、0z0x00,0x00,0x00,0x00,0x,0x,0x,0x,/*-文字:是-/*-宋体12;此字体卜对应的点阵为:宽X高=16x16-/0x00,Ox,Ox,OxOO,Ox7F,Ox49,Ox49,Ox49,0x49,0x49,0x49,0x49,0x7F,0x,0x,0x,0x00,0x81,0x81,0x89,0x89,0x89z0x89z0x89,0xFF,0x81,0x41,0x21,0xlD,0x21,0x41,0x81,/*-文字:最-7/*-末体12;此字体下对应的点阵为:宽xSm16x16-V000,0x40,0x40,0x40,0x5F,0xS5,055,0x55,0
12、x55,0xD5,0x55,0x55,0x5F,0xC0,0x40,0x40,0O0,0x8O,0x8O,0x43,0x2D,0x11,0x29,0x47,0x90,0xFF,0x15,0x15,0x25,Ox3F,0x6O,0x20,/-文字:._*/-宋体12;此字体下对应的点阵为:窕xl=16xl6-/OXoOQXoO,0x00,0x00,0x00,0x00,0x00,0x00,0x00QXOoQXOoQXOO,0x00,0x00,0x00,0x00,0x00,0x,0x,0x,0x,0,0x00,0x00,0x00,0x00,0xl8.0x24,0x24,0xl8,0x,0x,/*-文
13、字:无T/*-宋体12;此字体下对应的点阵为:宽1=16xl6-/0xO0,0x,Ox40.Ox40,0x42,0x42,0x42z0xC2,0x42.Ox7E,0xC2,0x42,0x42,0x42z0x40,0xO0,OXOOQXoo,0x70,0x40,0x40,0x40,0x40,0x3FQXOOQXOo,0x03,0x0CQXlo,0x20,0x40,0x80./-文字:却T/-宋体12;此字体下对应的点阵为:宽xl=16xl6-/0x00,0x,0xFC,0x04,0x04,0x04.0xFC,0x80,0x88,0x88,0x88.0xFF,0x88,0x88,0x88,0x80
14、,OxOO,OxOO,OxOFzOxlO,Ox08,OxOO,OxFF,OxOO,Ox30.0xl8,Oxl4,OxlO,013,Oxl4,Ox38zOxlO,/*-文字:近-7/-末体12;此字体下对应的点阵为:宽x1=16xl6-/0x00,0x20,0x22,0x23,0xE2,0x24,0x24,0x24,0xFC,0x,0x,0x,0xCC,0x42,0x40,0x40,0x00,0x40,0x40,0x40,0x5F,0x40,040,0x40,043,0x4C,050,020,0x1F,0x20,0x40,0x00,/*-文字:#-7/*-宋体12;此字体下对应的点阵为:窕xl=
15、16xl6-/0x00,0x20,0x20,0x29,0x29,Ox29,Ox29,O29,Ox2E,O3A,Ox6A,OxAA,Ox2A,Ox2A,0x22,0x20,OxOO,Ox,Ox,OxOO,OxFF,Ox55,Ox55,Ox55zOx55,Ox55,Ox55,OxFF,Ox01,Ox02,Ox04,Ox08,/-文字:遥T/-宋体12;此字体下对应的点阵为:宽xi=16xl6-/0x00,0x.0x2D,0x31,0x21,0xFl,0x2A,0x22,0x32,0x4A,0x00,0x00.0xCCz0x42,0x40,0x40,0x00,0x81,0xBDz0xAl,0xAlz
16、0xBF,0xAl,0xAl,0xBD,0x81,0x80,0x40,0x3F,0x40,0x80,0x,/-文字:色T/-宋体12;此字体下而应的点阵为:宽X高=16x16-/0x00,0x,0x.0xE0,0x20,0x2C,0x34,0x24,0xE4z0x24,0x24,0x27,0x24,0xE8,0xl0,0x20,0x00,0x78,0x40,0x43,0x42,0x42,0x42,0x42,Ox43,O42,O42,O42,0x42,Ox3F,OxO0,OxOO,/-文字:草-7/-宋体12;此字体下对应的点阵为:宽X高16xl6-VOxOO,Ox(M,Ox04,Ox04,Ox
17、E4,OxA4,OxAF,OxA4,OxA4,OxA4,OxAF,OxA4,OxE4,Ox04,Ox04,Ox04,000,0x08,0x08,0x08,0x0B,OxOA,OxOA,OxOA,OxFE,OOA,OxOA,OxOA,0x08,0x08,0x08,0x08,/*-文字:/*-宋体12;此字体下对应的点阵为:窕X高=16x16-/OXoOQXOO,0x00,0x00,0x00,0x00,0x00,0x00,0x00,OXoOQXOOQXoO,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0
18、x00,0x00,0x38,0x58,0x00,0x00,/*-文字:除-7/-宋体12;此字体下对应的点阵为:宽xi=16xl6-/0x00,0x42.0x43,0x42,0xFE,0x44,0x44,0x44,0x,0xF2z0xl2,0xFE.0xl2,0xFE,0xl2,0xF2,OxOO,Ox08,Ox06.0x01,OxFF,Ox03,OxOC,OxlO,OxOO,OxFF,Ox49,Ox49,Ox48,Ox49,Ox4A.OxFF,/-文字:如一/,-宋体12;此字体下对应的点阵为:宽X高=16x16-7OxOO,Ox,OxF8,Ox08,Ox08,Ox08,OxF8zOxOO,
19、OxOO,OxFO,OxlO,OxlO,OxlF,OxFO,OxlO,OxlO,0x00,0x,0x7F,0x20,0x20,0x20,0x7F,0x,0x00,0x61,0x16,0x08,0x14,0x22,0x41,0x80,/-文字:润-7/*-宋体12;此字体下对应的点阵为:宽XlftMl6x16-/OxOO,OxOO,OxFE,Ox02,Oxl2,Oxl2,OxF2,OxlO,Oxl6,Ox01,DxFC.Ox,Ox8C,0x02,0x60,0x10,OxOO.OxOO,Ox7F,Ox80zOx51,Oxll,OxlF,Oxll.Oxll,OxOO,OxFF,OxOOzOx01,O
20、x7e,Ox04zOx04,/-文字:雨-T/*-宋体12;此字体下对应的点阵为:窕xl=16xl6-/0x00,0x02,0xE2,0x22,0x22,0x22,0x22,022,OxFE,Ox22,Ox22,Ox22,0x22,0x22,OxE2,OxO2,0x00,0x00,Ox7F,Ox80,Ox40,Oxl2,009,OxOO,Ox7F,OxOOzOxl2,Ox09,OxOO,OxOO.OxFF,OxOO./*-文字:小T/-宋体12;此字体下对应的点阵为:,Xi=16xl6-/OxOO,Ox,Ox80,Ox40,Ox20,Ox,OxOO,OxOO,OxFF,OxOO,OxOO,Ox
21、OO,OxEO,OxOO,OxOO,OxOO,OxOOtOxOE,Ox01,OxOO.Ox,Ox,Ox,Ox,Ox7F,Ox80.0x40,Ox,OxOO,Ox03,Ox04zOx08,/-文字:街T/-宋体12;此字体下对应的点阵为:宽X高=16x16-/0x00,0x40,0x44,0xC4,0x44,0x40,024,0x24,0xBFz0x24,0x24,0x00,0x23,0xC4,0x88,0xl0,0x00,0x,0x.0x7F,0x80,0x40,0xl2,0xl2.0xlF,0x22,0x62,0x20,0x00,0xFF,0x00,0x01,/-文字:火-7/-宋体12;此
22、字体下对应的点阵为:Xll三16xl6-/0x00,0x40,0x40,0x42,0x42,0x42,0x42,0x42,0FE,0x42,0x42,0x42,0x42,0x42,0x40,0x40,0x00,0x80,0x80,0x40,0x20,0xl0,0x0C,003,0x00,003,0x0C,0xl0,0x20,0x40,0x80,0x80,/-文字:早-*/-宋体12;此字体下对应的点阵为:窕xl=16xl6-/OxOO,Ox,Ox,OxOO,OxFE,Ox92,092,092,Ox92,Ox92,Ox92,Ox92,OxFE,OxOO,OxOO,OxOO,0x00,0x04,0
23、x04,0x04,0x04,0x04,0x04,0x04,0xF0x04,0x04,0x04,0x04,0x04,0x04,0x04,/*-文字:#-/*-宋体12;此字体下对应的点阵为:宽X高=16x16-/0x00.0x40,0x44,0x54,0x54,0xD4z054,054,05F,0x74,0x54,0xD4,0x54,0x54,0x44,0x40,0x00,0x04,0x04,0x02,0x01,0xFEz0x92,0x92,0x92.0x92.0x92.0xFE,0x01z0x02,0x04,0x04,/*文字:-7/-宋体12;此字体下对应的点阵为:宽X高=16x16-/Ox
24、OO,Ox08,Ox48,Ox48,Ox48,OxFF,Ox48,Ox48,OxOO,Ox08zOxE8zOxA8,OxBF,OxA8,OxE8,Ox08rOxOO,OxlE,Ox22,Oxl2,Ox02,OxFF,Ox02,002,Ox02,Ox08,OxOB,OxOA,OxFE,OxOA.OxOB,Ox08,/*-文字:意-7/*-宋体12;此字体下对应的点阵为:宽X高16xl6-/0x00,0x10,0x10,0xE8,0x08,0x04,0CC,OxOA,009,0xEA,OxAC,0x4,OxA8,0xE8,0xl0,0x10,OxOO.OCO,Ox20,OxOF,OxC8,Ox80
25、,083,OxAO,Ox90,Ox8F.Ox8A,Ox62,Ox02,OxOF,Ox60,Ox80,/*-文字:作-*/-宋体12;此字体下对应的点阵为:窕xl=16xl6-/0x00,0x08,0x08,0x88,0x88,088,088,0xF8,0x0Fz0x30,0x40,007,0xF8,0x60,0x80,0x00,0x00,0x00,0x08,Ox08,Ox08,Ox08,Ox08,OxFFzOxOO,OxOO,OxOO,OxOO,OxFF,OxOO,OxOO,Ox01,/*-文字:制-*/*-宋体12;此字体下对应的点阵为:宽xi=16xl6-7OxOO,OxOO,OxFF,O
26、xOO,0x00,0xF8z0x40,048,0x48,048,0xFF,048,048,04E,0x50.040,OxOO,Ox,Ox7F,Ox80,Ox4O,0xOF,Ox,OxlE,Ox22,Oxl2,OxFF,OxO2zOxO2zOx3EzOxO0,OxO0z/*-文字:-7/*-宋体12;此字体卜对应的点阵为:宽X高=16x16-/0x00,0x80,0x82.0x82,0xBAz0xAA.0xAA,0xAA,0xAB,0xAA,0xAA,0xAA,0xBA.0x82,0x82,0x,0x00,0x01,0x42,0x40,0x22,0x2A,0xl2,0xF2,0AA,0x56,0
27、x56,0xAA,0xAA,0xA0,0x01,0x02,/-文字:周-7宋体12;此字体下对应的点阵为:宽X高=16x16JlOxOO,OxOO,Ox.OxFEzOx82,Ox92,Ox92,Ox92.0xFErOx92rOx92zOx92,Ox82,OxFE,OxOO,Oxr0x00,0x00,0x00,07FzOx8O0x40,O1,Ox12,O12,O12,01E,OxO0,Ox0O,OxlF,0x60z0x80zucharnum;voidmain()(1.CdI2864while(l)1.cdl2864_ClearScreen();Deayl0ms(60);1.cdl2864.Wri
28、tel6CnCHAR(72,0r32);早DeIaylOms(GO);Udl2864-Writel6CnCHAR(40A33);/OelaVlOmS(60);1.cdl2864.Writel6CnCHAR(64,2r34);韩DeIaylOms(GO);lcdl2864_Writel6CnCHAR48,2,35);愈DelaVlomS(200);1.cdl2864_ClearScreen();DelaYlOmS(60);1.cdl2864_Writel6CnCHAR(112,0.31;第1行DeIaylOms(GO);1.cdl2864.Wrftel6CCHAR(96A30);OelayIOm
29、S(60);1.cdl2864.Writel6CnCHAR(80,0,29);DelaVIomS(60);1.cdl286Writel6CnCHAR(64,0r28);DelaVIOmS(60);1.cdl2864.Writel6CnCHAR(48,0,27);Delal0ms(60);1.cdl2a64.Writel6CnCHAR(32,0r26);OelaVIOmS(60);1.cdl286Writel6CnCHAR(16,0,25);DeIaylOms(SO);1.cdl2S64,Writel6CnCHAR(024);DeiaYIom$(200);1.cdl286Writel6CnCHA
30、R112,2,23);第2行DelaylOmS(60);1.cdl286;Delayl0ms(60);Udl2864.Writel6CnCHAR(96A14);DeIaVlomS(60);1.cdl2864.Writel6CnCHAR(80,4r13);Delal0ms(60);lcdl286Writel6CnCHAR(64,4,12);DeIaylOms(GO);1.cdl286Writel6CnCHAR(48,4rll);DelaYlOmS(60);1.cdl2864.Writel6CnCHAR(32,4,10);Delal0ms(60);1.cdl2S64.Writel6CnCHAR(1
31、6,4f9);0.2.4.6(尽疑不要)DelaVIomS(60);1.cdl2864.Writel6CnCHAR(0A8);Delal0ms(200);1.cdl2864.Writel6CnCHAR(112,6,7);Delal0ms(60);1.cdl2S64.Writel6CnCHAR(96,6r6);DeIaylomS(60);1.cdl286Writel6CnCHAR(80,6,5);DeIaVIomS(60);1.cdl286Writel6CnCHAR(64,6r4);DeIaylOmS(60);1.cdl286Writel6CnCHAR(48,6r3);Delayl0ms(60)
32、;1.cdl2S64.Writel6CnCHAR(32,6r2);DeIaylOms(GO);第3行HX可选择为/Y选择笫4行1.cdl2864.Writel6CnCHAR(16,6,l);0elayl0ms(60);1.cdl2864_Writel6CnCHAR(0,6,0);Delayl0ms(2);1.cdl2864_ClearScreen();Delayl0ms(60);Udl2864-Writel6CnCHAR(80,2,39);周Delayl0ms(60);1.cdl286Writel6C11CHAR(64,2,38);豪DeIaylOms(GO);Ud12864_Writel6C
33、nCHAR(48,2,37);制Oelaylom$(60);1.cdl2860;c-)for(b=380-)函数名函数功能输入输出for(a=130;a0;a-);:1.CD12864_WriteCmd:写入一个吩咐到12864:Cmd:无void1.cdSt7565_WriteCmd(cmd)1.CD12864,CS三O;1.CD1286RD=1;1.CD12864.RS=0;1.CD1286RW=0;_nop_();-110P-0;ChiPSeleCt,打开片选/disableread.读失能/selectcommand.选择吩咐/selectwrite.选择n模式DATA_PORT=cm
34、d;/putcommand.放里吩咐-110PJ);_nopj);1.CD12864_RW=1;/commandwriting.写入吩咐函数名函数功能输入输出:1.cdSt7565-WriteData:写入一个数据到12864:dat:无%*,*%*xx*%W*void1.CdSt7565_WriteData(dat)1.CD12864,CS=O;ICD12864_RD=1;1.CD12864_RS=1;1.CD12864_RW=0;_nopj);,OPJ);/chipselect.打开片选/disableread,读失能/selectdata.选择数据/selectwrite.选择写模式DA
35、TA.PORTdat;/putdata,放置数据_nopj);_nop_0;1.CD12864_RW=1;/datawriting.写数据函数名函数功能:1.CD12864Jnit:初始化12864:无:无:1.CD12864的吩咐指令可以查看例程文件夹下的T7S65p数据手册的第51页的位置,void1.cdl2864Jnit()ucharI;1.CD12864_RSET0;for(i=0;il;i+);1.CD12864,CS=0;1.CD12864_RSET=1;/StarInitialSequence/-程序初始化设汽,详细吩咐可以看文件夹下一-软件初始化-1.CdSt7565_Wri
36、teCmd(OXE2);/resetfor(i=0;l100;i+);延时一下-表格第8个吩咐.OXAO段左右方向选择正常方向(OxAl为反方向1.cdSt7565-WriteCmd(0xAl);/ADCselectsegmentdirection衣格第15个吩咐,OxCS般(上F)方向选择选择反向,OXeO为IE常方向ICdSt7565_WriteCmd(OXC8);/Commondirection表格笫9个吩咐,0xA6为设置字体为黑色,背景为白色一-0xA7为设置字体为白色,背亮为黑色-1.cdSt756S-WriteCmd(0xA6);/reversedisplay-表格笫10个吩时,
37、OXA4像素正常显示,0xA5像素全开1.cdSt7565_WriteCmd(0xA4);/normaldisplay-我格第11个吩札0xA3保压为l7,0xA2偏压为1/9-/ICdSt7565_WHteCmd(OXA2);/biasset1/9-表格第19个吩咐.这个是个双字节的吩咐,OXF800选择增压为4X;-0xF801,选择增压为5X.其实效果叁不多-ICdSt7565_WriteCmd0xF8);/Boostratioset1.cdSt7565_WriteCmd(0x01);/x4-表格第18个吩对,这个玷个双字节吩咐,鸟字节为0X81.低字节可以-选择从OXOO到0X3J用来
38、设阳Y景光时比%/1.cdSt7565_WriteCmd(0x81);/V0asetICdSt7565_WriteCmd(OX23);“表格第17个吩对,选择调整电阻率-ICdSt7565_WriteCmd(OX25);/Ra/Rbset一花格第16个吩咐,电源谀设-H1.cdSt7565.WriteCmd(0x2F);for(i=0;i100;I+);-我恪第2个吩咐,设置显示起先位置-1.cdSt7565_WriteCmd(0x40);/startline函数名函数功能输入*输出-表格第1个吩咐,开启故示-1.cdSt7565-WriteCmd(0xAF);/displayonfor(i=
39、0;il;i+);:1.CD12864,ClearScreen:清屏12864:无:无void1.cdl2864_ClearScreen(void)(uchari,k;for(i=0;i8;1+)ICdSt7565_WriteCmd(OXBo+i);1.cdSt7565.WriteCmd(0xl0);ICdSt7565_WriteCmd(OXo4);for(k=O;k128;k+)1.cdSt7565_WriteData(0x00);假如设置背般为白色时,清屏选择OXFF函数名函数功能 输入 输出 说明.:1.CD12864-Writel6CnCHAR:在12864上面甘写16X16的汉字:X
40、,ycn:无:该函数可以干腌书写字符申,但是书写是从右到左,所以输入的时*候用意输入.汉字的取模方式谙观看文件夹下的汉字取模软件的“运用说明void1.cdl2864_WritelGCnCHAR(ucharx,uchar,ucharj)(uchark,xlzx2;y*OxBO;求取Y坐标的(ft一谀置Y坐标-1.cdSt7565_WriteCmd(y);一设置Y坐标-1.cdSt7S6S_WriteCmd(y);xl=(x4)&0x0F;由于X坐标要两句吩粒分凹凸4位,所以这里先取出高4位x2=X&OxOF;去低四位一设置X坐标-lcdSt7565_WriteCmd(0xl0+1);/14位1.cdSt7565_WriteCmd(0x04+x2);低4位for(k=0;k32;k+)写一个字If(k=16)由于16X16用到两个Y坐标,当大于等于16时.切换坐标(-设置Y坐标-IxdSt756S-WriteCmd(yl);设置X坐标1.CdSt7S6S_WriteCmd(OXIo+xl);高4位1.cdSt7565.WriteCmd(0x04+x2);低4位ICdSt7565_WriteData(Sble(j)(k);