3、_E=0;}LCD_E=0;LCD_CS1=1;〃片禁能//=====写命令到寄存器=二二=voidsend_cmd(ucharcmd)smallcheck_busy();LCD_RS=0;LCD_RW=0;LCD_CS1=O;data_bus=cmd;LCD_E=1;〃使能_nop_();_nop_();LCD_E=0;_nop_();_nop_();LCD_CS1=1;〃写的是命令〃写命令〃片使能〃片禁能//=====写数据到DDRAMvoidsend_dat(uchardat)small{check_busy();LCD_RS=1;LCD_RW=0;LCD_CS1=O;data_bus
4、=dat;LCD_E=1;_nop_();_nop_();LCD_E=0;_nop_();_nop_();LCD_CS1=1;}//======初始化〃写的是数据〃写数据〃片使能〃片禁能voidlcd_initial(void)small{LCD_RES=0;delay_nms(50);LCD_RES=1;LCD„E=0;delay_nms(50);send_cmd(0xA0);send_cmd(0xC8);send_cmd(0xA2);send_cmd(0x2C);send_cmd(0x2E);send_cmd(0x2F);send_cmd(0x25);send_cmd(0x81);sen
5、d_cmd(0x!4);send_cmd(OxAF);send_cmd(OxEO);send_cmd(0x40);//=======写列地址==============voidSet_Colume_Address(unsignedchardat){unsignedchartmp;tmp=dat»4;send_cmd(Ox10
6、tmp);〃送列地址高三位tmp=0x0f&dat;send_cmd(tmp);〃送列地址低四位}codeunsignedcharnumber[][16]={/*-文字:0-*/严・・宋体12;此字体下对应的点阵为:宽x高=8x16-*/0x00,0xE0,0x10,0
7、x08,0x0&0x10,0xE0,0x00,0x00,OxOF,Ox10,0x20,0x20,Ox10,0x0F,0x00,/*-文字:1-*/IJ宋体12;此字体下对应的点阵为:宽x高=8x16・・*/0x00,Ox10,()x1(),0xF&0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x0(),0x00,/*-文字:2-*//*・・宋体12;此字体下对应的点阵为:宽x高=8x16-*/0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x3
8、0,0x00,/*-文字:3-*//*-宋体12;此字体下对应的点阵为:宽x高=8x16-*/0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x1&0x20,0x20,0x20,Ox11,0x0E,0x00,/*-文字:4-*//*-宋体12;此字体下对应的点阵为:宽x高=8x16-*/0x00,0x00,0xC0,0x20,Ox10,OxF8,0x00,0x00,