#include <reg52.h>
#include <intrins.h>
typedef unsigned char uchar;
typedef unsigned int uint;
/****************************************************************************************/
// Pin Definition
/****************************************************************************************/
sbit SDA = P1^1;
sbit SCL = P1^0;
sbit RST = P1^2;
sbit Add_key = P2^0;
sbit Sub_key = P2^1;
sbit Run_key = P2^2;
#define Positive 7
#define Natural 24
#define Negative 7
void SetVLCD(void) ;
unsigned char VLCD = Natural;
unsigned char Rab = 0x05;
unsigned char code a[]= //+02
{
0x2b,0x30,0x32,0x00
};
unsigned char code b[]= //-02
{
0x2d,0x30,0x32,0x00
};
unsigned char code Init[]={
(0x31),//function set:(IS=1 ,RE=0) DL=1,8 bit ;N=1,2-line or 4-line
(0x18+0x03),//internal divider/OSC frequency:011,540kHZ;BS0 = 1,1/4 bais
/*
(0x7f),// contrast set
(0x5f),// prower Icon control/contrast set
(0x65), //follower control */
(0x06),//Entry Mode Set I/D=1,DDRAM address is increased by 1
(0x0C),//Display ON/OFF Control: D=1->entire display is turen on,C=1->cursor is turned on,B=0->cursor blink is off.
(0x02),//Return Home
(0x32),//function set:(REV=0 ,RE=1) DL=1,8 bit ;N=0,1-line or 3-line
(0x06),//COM1-->COM8,SEG100-->SEG1
(0x10),//BS1=0
(0x08),//5-dot,1-line
(0x01),//clear display
};