//图形显示128*64 void LCDPaintFullScreen (unsigned char *pic) { unsigned char x,y,i; unsigned int tmp=0; for(i=0;i<9;){ //分两屏,上半屏和下半屏,因为起始地址不同,需要分开 for(x=0;x<32;x++){ //32行 WriteCommandLCD(0x36); //Delay_us(200); WriteCommandLCD((0x80+x));//列地址 //Delay_us(200); WriteCommandLCD((0x80+i)); //行地址,下半屏,即第三行地址0X88 //Delay_us(200); //WriteCommandLCD(0x30); //Delay_us(200); for(y=0;y<16;y++) { WriteDataLCD(pic[tmp+y]);//读取数据写入LCD //Delay_us(200); } tmp+=16; } i+=8; } //Delay_us(200); //WriteCommandLCD(0x36); //扩充功能设定 //Delay_us(200); WriteCommandLCD(0x30); //Delay_us(200); }
/* Displays a message on LCD */ void DisplayLCD(char LineNumber,char *Message) { int a,i; if(LineNumber ==1) { //First Line WriteCommandLCD(0x80); //Select the first line } else { //Second line WriteCommandLCD(0xc0); //Select the second line } for(a=0;a<16;a++) { WriteDataLCD(*Message); //Display a character Message++; //Increment pointer } /* while(Message[i] != '\0') { WritrDataLCD(Message[i]); i++; } */ return; }
/******************************************************************************************** **函数名称: DisplayOneChar(unsigned char X, unsigned char Y, unsigned char DData) **函数功能: 指定位置写入单个数据 **输入参数: unsigned char X 为横坐标, unsigned char Y为显示行, unsigned char DData为数据 **输出参数: none **返 回 值: none **创 建 人: whble **创建日期: 2013-7-25 ********************************************************************************************* **修 改 人: **修改说明: ********************************************************************************************/ void DisplayOneChar(unsigned char X, unsigned char Y, unsigned char DData) { Y &= 0x1; X &= 0xF; if(Y) X |= 0x40; X |= 0x80; WriteCommandLCD(X, 0); //这里不检测忙信号,发送地址码 WriteDataLCD(DData); }