是哪里出问题了?请为我指点迷津
代码
#include <reg52.h>
sbit RS=P0^7;
sbit RW=P0^6;
sbit EN=P0^5;
void Read_Busy()
{
unsigned char busy;
P2=0xff;
RS=0;
RW=1;
do
{
EN=1;
busy=P2;
EN=0;
}while(busy&0x80);
}
void Write_command(unsigned char command)
{
Read_Busy();
RS=0;
RW=0;
P2=command;
EN=1;
EN=0;
}
void Write_Date(unsigned char date)
{
Read_Busy();
RS=1;
RW=0;
P2=date;
EN=1;
EN=0;
}
void main()
{
Write_command(0x38);//设置16*2显示
Write_command(0x0c);//开显示
Write_command(0x06);//地址指针加一
Write_command(0x80);//显示地址
Write_command(0x01);//清屏
Write_Date(2+'0');
while(1);
}