2、CDRw=0;LCDData=cmdcode;LCDDelay(2);LCDEn=1;LCDDelay(2);LCDEn=0;}voidwrite_data(charLCDDispdata){CheckState();LCDRs=1;LCDRw=0;LCDData=LCDDispdata;LCDDelay(2);LCDEn=1;LCDDelay(2);LCDEn=0;}voidLCDInit(){LCDDelay(100);LCDCs1=1;LCDCs2=1;LCDDelay(100);write_com(LCD
3、DispOff);write_com(PageAdd+0);write_com(StartLine+0);write_com(LCDColAdd+0);write_com(LCDDispOn);}voidLCDClear(){chark,j;LCDCs1=0;LCDCs2=0;write_com(PageAdd+0);write_com(LCDColAdd+0);for(k=0;k<8;k++){write_com(PageAdd+k);for(j=0;j<64;j++){write_com(LCDColAdd+
4、j);write_data(0x00);}}}voidLCDWriteChinese(charleftright,charpage,charcolumn,charchinese[]){chari=0,j=0;if(leftright=='L'){LCDCs1=0;LCDCs2=1;}elseif(leftright=='R'){LCDCs1=1;LCDCs2=0;}for(i=0;i<2;i++){write_com(PageAdd+page+i);write_com(LCDColAdd+column);for(
5、j=0;j<16;j++){write_data(chinese[16*i+j]);}}}voidLCDWriteChineseBlack(charleftright,charpage,charcolumn,charchinese[]){chari=0,j=0;if(leftright=='L'){LCDCs1=0;LCDCs2=1;}elseif(leftright=='R'){LCDCs1=1;LCDCs2=0;}for(i=0;i<2;i++){write_com(PageAdd+page+i);write
6、_com(LCDColAdd+column);for(j=0;j<16;j++){write_data(~chinese[16*i+j]);}}}voidLCDWriteNum(charleftright,charpage,charcolumn,charnum[]){chari=0,j=0;if(leftright=='L'){LCDCs1=0;LCDCs2=1;}elseif(leftright=='R'){LCDCs1=1;LCDCs2=0;}for(i=0;i<2;i++){write_com(PageAd
7、d+page+i);write_com(LCDColAdd+column);for(j=0;j<8;j++){write_data(num[8*i+j]);}}}voidLCDWriteNumBlack(charleftright,charpage,charcolumn,charnum[]){chari=0,j=0;if(leftright=='L'){LCDCs1=0;LCDCs2=1;}elseif(leftright=='R'){LCDCs1=1;LCDCs2=0;}for(i=0;i<2;i++){wri
8、te_com(PageAdd+page+i);write_com(LCDColAdd+column);for(j=0;j<8;j++){write_data(~num[8*i+j]);}}}Lcd12864.h#ifndef__LCD12864_H#define__LCD12864_H#include#defineLCDDispOff0x3e#defin