延時(shí)大就非常穩(wěn)定,但是執(zhí)行速度卻下來(lái)了,延時(shí)小卻不大穩(wěn)定。最后終于把延時(shí)時(shí)間給調(diào)的合適而使其達(dá)到執(zhí)行速度快而且穩(wěn)定的效果。注意由于LPC2131是3.3V的電壓,而OCMJ4X8C是5V供電,因此兩者最好共地,在條件允許的情況下,可以給LPC2131和OCMJ4X8C的接口加一個(gè)3.3V轉(zhuǎn)5V的電平轉(zhuǎn)換電路,使其更加穩(wěn)定,不加亦可。
- //=====================================================================
- // OCMJ4X8C 液晶驅(qū)動(dòng)程序(串行)
- //硬件連接: CS --P0^4;
- // STD --P0^5;
- // SCLK--P0^6;
- // PSB --VSS;
- // RST --VDD;
- // VDD--邏輯電源(+5V)
- // VSS--GND(0V)
- //ocm4x8c(串).c
- //writer:谷雨 2008年8月2日于EDA實(shí)驗(yàn)室
- //說(shuō)明: 修改端口的時(shí)候只需修改定義口以及函數(shù)void Lcd_IO_Inti (void)即可
- //=====================================================================
- #include "config.h"
- #define comm 0
- #define dat 1
- #define x1 0x80
- #define x2 0x88
- #define y 0x80
- //**************************修改硬件時(shí)要修改的部分********************************
- /*定義CS控制*/
- #define Lcd_CS 4 //串行口使能,高電平有效(作RS時(shí),1為數(shù)據(jù),0為指令)
- #define Set_CS() IO0SET =1<<Lcd_CS
- #define Clr_CS() IO0CLR =1<<Lcd_CS
- /*定義STD控制*/
- #define Lcd_STD 5 //串口數(shù)據(jù)(作R/W時(shí),1為讀,0為寫(xiě))
- #define Set_STD() IO0SET =1<<Lcd_STD
- #define Clr_STD() IO0CLR =1<<Lcd_STD
- /*定義SCLK控制*/
- #define Lcd_SCLK 6 //串口時(shí)鐘,高電平有效
- #define Set_SCLK() IO0SET =1<<Lcd_SCLK
- #define Clr_SCLK() IO0CLR =1<<Lcd_SCLK
- //**************************函數(shù)定義********************************
- static void Delay_1(uint32 time);
- static void wr_lcd (uint8 dat_comm,uint8 content);
- extern void Lcd_IO_Inti(void);
- extern void Lcd_Inti(void);
- extern void set_position(uint8 xx,uint8 yy);
- extern void send_str(uint8 const *cc);
- extern void send_disp (uint8 const *img);
- extern void send_img1(uint8 const *img);
- extern void lat_disp (uint8 data1,uint8 data2);
- extern void con_disp (uint8 data1,uint8 data2,uint8 x0,uint8 y0,uint8 xl,uint8 yl);
- extern void con_disp_line (uint8 line);
- extern void clear (void);
- extern void clear_line(uint8 line);
- extern void clear_point(uint8 line,uint8 row);
- //======================================================
- // 函數(shù)名稱 : Delay_1()
- // 函數(shù)功能 : 1微秒延時(shí)
- // 入口參數(shù) : time 延時(shí)的毫秒數(shù)
- // 出口參數(shù) : 無(wú)
- //======================================================
- void Delay_1(uint32 time)
- {
- while(time--);
- }
- //=================================================================
- // 函數(shù)名稱 :void Lcd_IO_Inti (void)
- // 函數(shù)功能 :實(shí)現(xiàn)lcd IO 口初始化
- // 入口參數(shù) :無(wú)
- // 出口參數(shù) :無(wú)
- //=================================================================
- void Lcd_IO_Inti(void)
- {
- PINSEL0&=(~0x3f00);
- IO0DIR|= (1<<Lcd_CS) | (1<<Lcd_STD) | (1<<Lcd_SCLK); //設(shè)置Lcd_CS,Lcd_STD,Lcd_SCLK為輸出
- IO0CLR = (1<<Lcd_CS) | (1<<Lcd_STD) | (1<<Lcd_SCLK); //Lcd_CS,Lcd_STD,Lcd_SCLK置低消除影響
- }
- //=================================================================
- // 函數(shù)名稱 :void Lcd_Inti(void)
- // 函數(shù)功能 :實(shí)現(xiàn)lcd初始化
- // 入口參數(shù) :無(wú)
- // 出口參數(shù) :無(wú)
- //=================================================================
- void Lcd_Inti(void)
- {
- wr_lcd (comm,0x30); //30---基本指令動(dòng)作
- wr_lcd (comm,0x01); //清屏,地址指針指向00H
- Delay_1 (0xffff); //清屏需較長(zhǎng)時(shí)間
- wr_lcd (comm,0x06); //光標(biāo)的移動(dòng)方向
- wr_lcd (comm,0x0c); //顯示打開(kāi),光標(biāo)關(guān),反白關(guān)
- }
- //=================================================================
- //函數(shù)名:void set_position(uint8 xx,uint8 yy)
- //函數(shù)功能: 設(shè)定顯示坐標(biāo)
- //入口參數(shù):xx yy
- // xx:0~3 yy:0~7
- //出口參數(shù):無(wú)
- //=================================================================
- void set_position(uint8 xx,uint8 yy) //坐標(biāo)
- {
- uint8 line;
- wr_lcd (comm,0x30); //30---基本指令動(dòng)作
- switch(xx)
- {
- case 0:line=0x00;break;
- case 1:line=0x10;break;
- case 2:line=0x08;break;
- case 3:line=0x18;break;
- default:break;
- }
- wr_lcd(comm,0x80+line+yy); //設(shè)定地址
- }
- //=================================================================
- //函數(shù)名:void send_str(uint8 *cc)
- //函數(shù)功能: 顯示漢字或是字符
- //入口參數(shù):*cc
- //出口參數(shù):無(wú)
- //注意:注意為全角字符,即每個(gè)字符占十六個(gè)字節(jié)
- // 顯示漢字或者字符時(shí)先設(shè)定顯示坐標(biāo),最多顯示8個(gè)漢字
- //=================================================================
- void send_str(uint8 const *cc)
- {
- uint8 i;
- wr_lcd (comm,0x30);
- for(i=0;(i<16)&&*(cc+i);i++)
- wr_lcd(dat,*(cc+i));
- }
- //=================================================================
- //函數(shù)名:void send_disp (uint8 const *img)
- //函數(shù)功能: 顯示圖形
- //入口參數(shù):uchar code *img
- //出口參數(shù):無(wú)
- //注意:顯示圖形時(shí)先寫(xiě)第一行數(shù)據(jù),依次向后
- //=================================================================
- void send_disp (uint8 const *img)
- {
- uint8 i,j;
- for(j=0;j<32;j++) //上半屏寫(xiě)入圖形數(shù)據(jù)
- {
- for(i=0;i<8;i++)
- {
- wr_lcd (comm,0x34); //8位控制端口,選擇擴(kuò)充指令集
- wr_lcd (comm,y+j); //選擇圖形區(qū)Y軸坐標(biāo)
- wr_lcd (comm,x1+i); //選擇圖形區(qū)X軸坐標(biāo)
- wr_lcd (comm,0x30); //選擇基本指令集
- wr_lcd (dat,img[j*16+i*2]); //寫(xiě)圖形數(shù)據(jù)
- wr_lcd (dat,img[j*16+i*2+1]);
- }
- }
- for(j=32;j<64;j++) //下半屏寫(xiě)入圖形數(shù)據(jù)
- {
- for(i=0;i<8;i++)
- {
- wr_lcd (comm,0x34);
- wr_lcd (comm,y+j-32);
- wr_lcd (comm,x2+i);
- wr_lcd (comm,0x30);
- wr_lcd (dat,img[j*16+i*2]);
- wr_lcd (dat,img[j*16+i*2+1]);
- }
- }
- wr_lcd (comm,0x36); //寫(xiě)入數(shù)據(jù)后選擇圖形顯示
- }
- //=================================================================
- //函數(shù)名:void send_img1(uint8 const *img)
- //函數(shù)功能: 下半屏顯示圖形
- //入口參數(shù):uchar code *img
- //出口參數(shù):無(wú)
- //=================================================================
- void send_img1(uint8 const *img)
- {
- uint8 i,j;
- for(j=0;j<32;j++)
- {
- for(i=0;i<8;i++)
- {
- wr_lcd (comm,0x34);
- wr_lcd (comm,y+j);
- wr_lcd (comm,x2+i);
- wr_lcd (comm,0x30);
- wr_lcd (dat,img[j*16+i*2]);
- wr_lcd (dat,img[j*16+i*2+1]);
- }
- }
- wr_lcd (comm,0x36);
- }
- //=================================================================
- //函數(shù)名:void lat_disp (uint8 data1,uint8 data2)
- //函數(shù)功能:顯示點(diǎn)陣
- //入口參數(shù):uchar data1 奇數(shù)行顯示的點(diǎn)陣
- // uchar data2 偶數(shù)行顯示的點(diǎn)陣
- //出口參數(shù):無(wú)
- //=================================================================
- void lat_disp (uint8 data1,uint8 data2)
- {
- uint8 i,j,k,x;
- x=x1;
- for(k=0;k<2;k++)
- {
- for(j=0;j<16;j++)
- {
- for(i=0;i<8;i++)
- {
- wr_lcd (comm,0x34); //8位控制端口,選擇擴(kuò)充指令集
- wr_lcd (comm,y+j*2); //Y軸
- wr_lcd (comm,x+i); //X軸
- wr_lcd (comm,0x30); //選擇基本指令集
- wr_lcd (dat,data1); //寫(xiě)入數(shù)據(jù)
- wr_lcd (dat,data1);
- }
- for(i=0;i<8;i++)
- {
- wr_lcd (comm,0x34);
- wr_lcd (comm,y+j*2+1);
- wr_lcd (comm,x+i);
- wr_lcd (comm,0x30);
- wr_lcd (dat,data2);
- wr_lcd (dat,data2);
- }
- }
- x=x2;
- }
- wr_lcd (comm,0x36); //寫(xiě)入數(shù)據(jù)后選擇顯示
- }
- //=================================================================
- //函數(shù)名:void con_disp (uchar data1,uchar data2,uchar x0,uchar y0,uchar xl,uchar yl)
- //函數(shù)功能:反白顯示
- //入口參數(shù):data1,data2,x0,y0,x1,y1
- // 當(dāng)data1=0xff,data2=0xff時(shí),在x0,y0處開(kāi)始反白顯示區(qū)域?yàn)?6*xl*yl.
- //出口參數(shù):無(wú)
- //=================================================================
- void con_disp (uint8 data1,uint8 data2,uint8 x0,uint8 y0,uint8 xl,uint8 yl)
- {
- uint8 i,j;
- for(j=0;j<yl;j++)
- {
- for(i=0;i<xl;i++)
- {
- wr_lcd (comm,0x34);
- wr_lcd (comm,y0+j);
- wr_lcd (comm,x0+i);
- wr_lcd (comm,0x30);
- wr_lcd (dat,data1);
- wr_lcd (dat,data2);
- }
- }
- wr_lcd (comm,0x36);
- }
- //=================================================================
- //函數(shù)名:void con_disp_line (uint8 line)
- //函數(shù)功能:選擇某行反白顯示
- //入口參數(shù):line
- // line為1或者2,1選擇1、3行反白顯示,2選擇2、4行反白顯示
- //出口參數(shù):無(wú)
- //=================================================================
- void con_disp_line (uint8 line)
- {
- uint8 a;
- wr_lcd (comm,0x34); //8位控制端口,選擇擴(kuò)充指令集
- switch(line)
- {
- case 1:a=0x04;break;
- case 2:a=0x05;break;
- default:break;
- }
- wr_lcd (comm,a); //反白選擇
- Delay_1(0xffff);
- wr_lcd (comm,0x36); //顯示
- }
- //=================================================================
- //函數(shù)名:void clear()
- //函數(shù)功能:清屏
- //入口參數(shù):無(wú)
- //出口參數(shù):無(wú)
- //=================================================================
- void clear (void)
- {
- wr_lcd (comm,0x30); //選擇基本指令集
- wr_lcd (comm,0x01); //清屏
- Delay_1(0xffff); //延時(shí)
- }
- //=================================================================
- //函數(shù)名:void clear_line(uint8 line)
- //函數(shù)功能:清除一行
- //入口參數(shù): line 0~3
- //出口參數(shù):無(wú)
- //=================================================================
- void clear_line(uint8 line) //清除一行(0~3行)
- {
- uint8 i;
- set_position(line,0);
- for(i=0;i<16;i++)
- wr_lcd (dat,0x20);//填充空格
- }
- //=================================================================
- //函數(shù)名:void clear_point(uint8 line,uint8 row)
- //函數(shù)功能:清除一點(diǎn)
- //入口參數(shù): line 選擇的行
- // row 選擇的列
- //出口參數(shù):無(wú)
- //=================================================================
- void clear_point(uint8 line,uint8 row)
- {
- set_position(line,row);
- wr_lcd (dat,0x20);//填充空格
- wr_lcd (dat,0x20);
- }
- //=================================================================
- // 函數(shù)名稱 :void wr_lcd (uint8 dat_comm,uint8 content)
- // 函數(shù)功能 :向lcd中寫(xiě)數(shù)據(jù)或者指令
- // 入口參數(shù) :dat_comm 選擇是寫(xiě)數(shù)據(jù)或者寫(xiě)指令位
- // content dat_comm為1時(shí)寫(xiě)數(shù)據(jù),否則寫(xiě)指令
- // 出口參數(shù) :無(wú)
- //=================================================================
- void wr_lcd (uint8 dat_comm,uint8 content)
- {
- uint8 i,j;
- Clr_SCLK();
- Set_CS();
- Delay_1(1);
- Set_STD();
- for(i=0;i<5;i++) //寫(xiě)入5個(gè)1,作為啟動(dòng)位
- {
- Set_SCLK();
- Delay_1(1);
- Clr_SCLK();
- Delay_1(1);
- }
- Clr_STD();
- Set_SCLK();
- Delay_1(1);
- Clr_SCLK();
- Delay_1(1);
- if(dat_comm) //判斷寫(xiě)數(shù)據(jù)還是指令
- {
- Set_STD(); //data
- }
- else
- {
- Clr_STD(); //command
- }
- Set_SCLK();
- Delay_1(1);
- Clr_SCLK();
- Delay_1(1);
- Clr_STD(); //寫(xiě)入1個(gè)0
- Set_SCLK();
- Delay_1(1);
- Clr_SCLK();
- Delay_1(1);
- for(j=0;j<2;j++)
- {
- for(i=0;i<4;i++) //分別寫(xiě)入高四位和低四位
- {
- if(content&0x80)
- {
- Set_STD();
- }
- else
- {
- Clr_STD();
- }
- Set_SCLK();
- Delay_1(1);
- Clr_SCLK();
- Delay_1(1);
- content<<=1;
- }
- Clr_STD();
- for(i=0;i<4;i++) //寫(xiě)入4個(gè)0
- {
- Set_SCLK();
- Delay_1(1);
- Clr_SCLK();
- Delay_1(1);
- }
- }
- Clr_CS();
- Delay_1(1);
- }
- uint8 const tab5[]={
- /*-- 寬度x高度=128x64 --*/
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x80,0x00,0x0F,0xFF,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x0C,0x43,0x01,0x80,0x00,0x7F,0xFF,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x19,0xFF,0x07,0x00,0x07,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x01,0x3F,0xFC,0x1E,0x00,0x1F,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x01,0xBF,0xFF,0xFC,0x00,0x7F,0xFC,0x00,0x7F,0xC0,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x01,0xFF,0xFF,0xF0,0x00,0xFF,0xC0,0x00,0x0F,0xE0,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x01,0xFF,0xFF,0xE0,0x03,0xFF,0xFF,0xFC,0x01,0xF0,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x01,0xDF,0xFF,0xC0,0x07,0xFF,0xFF,0xFF,0x80,0xF0,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x03,0xFF,0xFF,0x00,0x0F,0xFF,0xFF,0xFF,0xE0,0x38,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x07,0xFF,0xF8,0x00,0x1F,0xFF,0xF0,0x03,0xF8,0x38,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x07,0xFF,0xE0,0x00,0x3F,0xFF,0xFF,0xC0,0x7C,0x18,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x04,0x7F,0xF0,0x00,0x3F,0xFF,0xFF,0xF8,0x1E,0x08,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x01,0xFF,0xF8,0x00,0x7F,0xFF,0xFF,0xFE,0x0F,0x08,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x0F,0xFF,0xFC,0x00,0xFF,0xFF,0xFF,0xFF,0x87,0x08,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x1F,0xFF,0xFE,0x00,0xFF,0xFF,0xFF,0xFF,0x83,0x88,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3F,0xFF,0xFE,0x01,0xFF,0xFF,0xFF,0xFF,0xC3,0x88,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7F,0xFF,0xFE,0x01,0xFF,0xFF,0xFF,0xFF,0xE1,0x88,0x00,0x00,0x00,
- 0x00,0x00,0x00,0xFF,0xFF,0xFE,0x03,0xFF,0xFF,0xFF,0xFF,0xE1,0x88,0x00,0x00,0x00,
- 0x00,0x00,0x01,0xFF,0xFF,0xFE,0x03,0xFF,0xFF,0xFF,0xFF,0xF1,0x88,0x00,0x00,0x00,
- 0x00,0x00,0x01,0xFF,0xFF,0xFE,0x03,0xFF,0xFF,0xFF,0xFF,0xF3,0x08,0x00,0x00,0x00,
- 0x00,0x00,0x01,0xFF,0xFF,0xFF,0x07,0xFF,0xFF,0xFF,0xFF,0xF2,0x10,0x00,0x00,0x00,
- 0x00,0x00,0x01,0xFF,0xFF,0xFF,0x8F,0xFF,0xFF,0xFF,0xFF,0xF0,0x20,0x00,0x00,0x00,
- 0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x70,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x70,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x70,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0x7F,0x20,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFF,0x7F,0x20,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0x7E,0x20,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0x3E,0x40,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xCF,0xFF,0x3C,0x40,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xCF,0xFE,0x38,0x40,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0x8F,0xFE,0x38,0x40,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0x8F,0xFE,0x30,0x40,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x1F,0x7C,0x20,0x40,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFE,0x1E,0x78,0x00,0x40,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFE,0x1E,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xDA,0x3C,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xF2,0x30,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xF1,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0xFE,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x7C,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x78,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x72,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x01,0x40,0x04,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x02,0x0C,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x02,0x40,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x0C,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x38,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x0F,0xE2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
- };
- //=================================================================
- //函數(shù)名: int main (void)
- //函數(shù)功能: 主函數(shù),用于測(cè)試,無(wú)實(shí)際意義
- //入口參數(shù): 無(wú)
- //出口參數(shù):無(wú)
- //=================================================================
- int main (void)
- {
- uint8 const tab[]={"中華人名共和國(guó)"};
- Delay_1(0x1fffff);
- Lcd_IO_Inti(); //初始化
- Lcd_Inti();
- while(1)
- {
- clear();
- lat_disp (0x00,0x00);
- Delay_1(0x1fffff);
- set_position(0,0); //顯示漢字
- send_str(tab);
- set_position(1,0);
- send_str(tab);
- set_position(2,0);
- send_str(tab);
- Delay_1(0x1fffff);
- clear_point(0,1); //清除一點(diǎn)
- Delay_1(0x1fffff);
- con_disp (0xff,0xff,0x8c,0x80,2,16); //區(qū)域反白顯示
- Delay_1(0x6fffff);
- con_disp_line(2); //行反白顯示
- Delay_1(0x6fffff);
- clear_line(1); //清除一行
- Delay_1(0x6fffff);
- clear();
- Delay_1(0x1fffff);
- lat_disp (0xcc,0xcc); //顯示點(diǎn)陣
- Delay_1(0x1fffff);
- clear();
- lat_disp (0x00,0x00);
- Delay_1(0x1fffff);
- clear();
- lat_disp (0xff,0x00); //顯示點(diǎn)陣
- Delay_1(0x1fffff);
- clear();
- send_disp(tab5); //顯示圖像
- Delay_1(0x6fffff);
- }
- return 0;
- }
復(fù)制代碼
|