#include
#include
#include
#include
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
sbit rs=P0^5;
sbit rw=P0^6;
sbit e =P0^7;
sbit hx711_dout=P3^3;
sbit hx711_sck =P3^4;
uint weight;
void delayms(uint z)
{
uchar i,j;
for(i=z;i>0;i--)
for(j=114;j>0;j--);
}
void write_com(uchar com)
{
rs=0;
P2=com;
delayms(1);
e=1;
delayms(1);
e=0;
}
void write_data(uchar date)
{
rs=1;
P2=date;
delayms(1);
e=1;
delayms(1);
e=0;
}
void write_string(uchar line,uchar add,uchar *p)
{
if(line==1)
write_com(0x80+add);
else
write_com(0x80+0x40+add);
while(1)
{
if(*p == '