资源描述:
《5110液晶驱动程序》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、/*****************5110是一个48行*84的点阵*******************************//************12列*16的汉字只能显示3行(48/16=3)**************************//*************12*12的汉字可以显示4行(48/12=4)*****************//**********将图片取模可以显示出图片*****************************///LCD_write_byte(0x09,0);//黑屏命令LCD_write_byte(0x0D,0
2、);//反映射输出(反白显示命令)#include#include#include#defineucharunsignedchar#defineuintunsignedintsbitres=P0^0;//复位,0复位sbitsce=P0^1;//片选端,低电平有效sbitdc=P0^2;//数据命令选择端,1写数据,0写指令sbitsdin=P2^0;//数据sbitsclk=P2^1;//时钟ucharl;//***************************取模汉字是12列*16的数字***********
3、*********************/ucharcodeDA[21][24]={{0x00,0xC0,0xF0,0x30,0x18,0x08,0x08,0x08,0x30,0xF0,0xC0,0x00,0x00,0x07,0x1F,0x18,0x30,0x20,0x20,0x20,0x18,0x1F,0x07,0x00},//0{0x00,0x00,0x10,0x10,0x10,0xF0,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x3F,0x3F,0x20,0x20,0x20,0x00,0x00},
4、//1{0x00,0x70,0x50,0x08,0x08,0x08,0x08,0x18,0xF0,0x70,0x00,0x00,0x00,0x20,0x30,0x28,0x24,0x24,0x22,0x21,0x20,0x38,0x00,0x00},//2{0x00,0x30,0x38,0x08,0x88,0x88,0xD8,0x78,0x30,0x00,0x00,0x00,0x00,0x18,0x38,0x20,0x20,0x20,0x20,0x31,0x1F,0x0E,0x00,0x00},//3{0x00,0x00,0x00,0x80,0x40,0x20,0x10,0
5、xF8,0xF8,0x00,0x00,0x00,0x00,0x06,0x05,0x04,0x04,0x24,0x24,0x3F,0x3F,0x24,0x24,0x00},//4{0x00,0x00,0xF8,0x08,0x88,0x88,0x88,0x88,0x08,0x08,0x00,0x00,0x00,0x18,0x19,0x21,0x20,0x20,0x20,0x31,0x1F,0x0F,0x00,0x00},//5{0x00,0xC0,0xE0,0x30,0x98,0x88,0x88,0x88,0x98,0x10,0x00,0x00,0x00,0x0F,0x1F,0
6、x11,0x20,0x20,0x20,0x20,0x31,0x1F,0x0E,0x00},//6{0x00,0x00,0x30,0x18,0x08,0x08,0x08,0x88,0x68,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x3E,0x01,0x00,0x00,0x00,0x00},//7{0x00,0x70,0xF0,0x98,0x88,0x88,0x08,0x08,0x98,0x70,0x70,0x00,0x00,0x0C,0x1E,0x31,0x20,0x21,0x21,0x21,0x33,0x1E,0x0C,0
7、x00},//8{0x00,0xE0,0xF0,0x18,0x08,0x08,0x08,0x08,0x10,0xF0,0xE0,0x00,0x00,0x01,0x11,0x33,0x22,0x22,0x22,0x32,0x19,0x0F,0x07,0x00},//9{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"."