51LCD1602液晶程序问题错哪了?
我编写的51显示LCD1602的程序在PROTEUS上仿真不能显示,各位大虾们帮忙看看,指教下。#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit RS=P2^5;
sbit RW=P2^6;
sbit E=P2^7;
uchar count;
uchar table[]="humin" ;
void delay(uchar del)//延期时
{
int i,j;
for(i=0; i<=del; i++)
for(j=0; j<=2; j++)
;
}
void write_com(uchar com) //液晶写命令
{
RS=0;
P0=com;
delay(100);
E=1;
delay(100);
E=0;
}
void write_date(uchar date) //液晶写数据
{
RS=1;
P0=date;
delay(100);
E=1;
delay(100);
E=0;
}
void init()
{
RW=0;
E=0;
write_com(0x38);
write_com(0x0c);
write_com(0x06);
write_com(0x01);
}
void disp(uchar x,uchar *p)
{ unsigned char y=0;
write_com(x);
while(p[y]!=0x00)
{
write_date(p[y]);
y++;
delay(100);
}
}
void main()
{
init();
delay(100);
disp(0x80+0x00,table);
}