資源描述:
《12864無字庫液晶顯示程序》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、以下是.H文件://***************************************************************************************////*12864LCD無字庫液晶驅(qū)動程序:*////*bitjisuan(ucharx,y,mode,uchar*p):*////*x:為行地址,范圍0~7;y為列地址,范圍:漢字0~112,字符0~120*////*mode為反白選著,mode=0,正常顯示,mode=1,反白顯示;*////*如果找不到該字符的字模,則返回0;*////*void
2、fuwei(void):*////*復(fù)位液晶*////*QQ:980105470(如有問題請聯(lián)系我)2012年07月04日(改)*////***************************************************************************************//#include#include#defineNOP_nop_()#defineDATP0#defineuintunsignedint#defineucharunsignedcharsbitFF
3、=P0^7;//忙碌標(biāo)志位sbitRS=P2^0;//sbitRW=P2^1;//sbitE=P2^2;//sbitCS1=P2^3;//sbitCS2=P2^4;//sbitRST=P2^5;//structzimu//{ucharzifu;uchartabzifu[16];};structhanzifu//{ucharhanzi[2];uchartabhanzi[32];};bitJiSuanLCD(ucharx,y,mode,uchar*p);//計(jì)算顯示漢字/字符程序voidFuWeiLCD(void);//復(fù)位液晶voidJiSuan
4、LCDShu(ucharx,y,mode,longintshu);//顯示數(shù)據(jù)程序(顯示整型數(shù)據(jù))voiddelaylcd(ucharz);//延時(shí)n個機(jī)器周期以下是.C文件:#include<12864lcd.h>codestructzimuziku[]={//字符模{'0',0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00},{'1',0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20
5、,0x20,0x3F,0x20,0x20,0x00,0x00},{'2',0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00},{'3',0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00},{'4',0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0
6、x3F,0x24,0x00},{'5',0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00},{'6',0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00},{'7',0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00},{'
7、8',0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00},{'9',0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00},/*{'a',0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20},{'b',0x08,0xF8,0x
8、00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00},{'c',0