#include "12864lcd.h"
#include "delay.h"
uchar code string_1[12]={"呼呼呼呼呼呼"};
uchar code a[12]={"电压= V"};
void wr_cmd(uchar cmd)
{
RS=0;
RW=0;
delay_50us(1);
lcd_data=cmd;
E=1;
delay_50us(10);
E=0;
delay_50us(2);
}
void wr_data(uchar wdata)
{
RS=1;
RW=0;
delay_50us(1);
lcd_data=wdata;
E=1;
delay_50us(10);
E=0;
delay_50us(2);
}
void init(void)
{
delay_50us(2000);
RST=1;
PSB=1;
wr_cmd(0x30); //基本指令操作
delay_50us(4);
wr_cmd(0x30);
delay_50us(4);
wr_cmd(0x0f);
delay_50us(4);
wr_cmd(0x01); // 清屏
delay_50us(240);
wr_cmd(0x06); //进入点设定 ,游标右移
delay_50us(4);
}
void display1(void)
{
uchar i;
wr_cmd(0x98);
delay_50us(1);
for(i=0;i<12;i++)
{
wr_data(a[i]);
delay_50us(1);
}
delay_50ms(4); } |