#include
#include
#include
#define uchar unsigned char
#define uint unsigned int
//********正转**********
unsigned char code FFW[8]={0x08,0x0c,0x04,0x06,0x02,0x03,0x01,0x09};
//********反转**********
unsigned char code REV[8]={0x09,0x01,0x03,0x02,0x06,0x04,0x0c,0x08};
//********数组**********
uchar shuzu[]={0x00,0x00,0x00};
sbit RS=P1^7;
sbit RW=P1^6;
sbit E=P1^5;
sbit ST=P3^0;
sbit OE=P3^1;
sbit EOC=P3^2;
sbit CLK=P3^7;
uchar getdata;
uchar temp;
uchar flag;
//*********延时**********
void delay(unsigned int t)
{
unsigned int k;
while(t--)
{
for(k=0; k<125; k++)
;
}
}
void delaynms(uint aa)
{
uchar bb;
while(aa--)
{
for(bb=0;bb<115;bb++) //1ms基准延时程序
{
;
}
}
}
//*********LCD显示*********
void fbusy()//查忙
{
P2=0xff;RS=0;RW=1;
E=0;E=1;
while(P2&0x80){E=0;E=1;}
}
void wr51r(uchar j)//写命令
{
fbusy();