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;〃寫的是命令〃寫命令〃片使能〃片禁能//=====寫數(shù)據(jù)到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;}//======初始化〃寫的是數(shù)據(jù)〃寫數(shù)據(jù)〃片使能〃片禁能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-*/嚴(yán)??宋體12;此字體下對應(yīng)的點(diǎn)陣為:寬x高=8x16-*/0x00,0xE0,0x10,0
7、x08,0x0&0x10,0xE0,0x00,0x00,OxOF,Ox10,0x20,0x20,Ox10,0x0F,0x00,/*-文字:1-*/IJ宋體12;此字體下對應(yīng)的點(diǎn)陣為:寬x高=8x16??*/0x00,Ox10,()x1(),0xF&0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x0(),0x00,/*-文字:2-*//*??宋體12;此字體下對應(yīng)的點(diǎn)陣為:寬x高=8x16-*/0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x3
8、0,0x00,/*-文字:3-*//*-宋體12;此字體下對應(yīng)的點(diǎn)陣為:寬x高=8x16-*/0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x1&0x20,0x20,0x20,Ox11,0x0E,0x00,/*-文字:4-*//*-宋體12;此字體下對應(yīng)的點(diǎn)陣為:寬x高=8x16-*/0x00,0x00,0xC0,0x20,Ox10,OxF8,0x00,0x00,