#include <reg52.h>
#include "mytouwenjian.h"
sbit RS=P2^4;
sbit RW=P2^5;
sbit E=P2^6;
void write_date(char date)
{
E=0;
RS=1;
RW=0;
P0=date;
yanshi_100us(1);
E=1;
}
void write_minling(char datea)
{
E=0;
RS=0;
RW=0;
P0=datea;
yanshi_100us(1);
E=1;
}
void chushihua_lcd()
{
write_minling(0x06);//
yanshi_100us(1);
write_minling(0x0c);//
yanshi_100us(1);
write_minling(0x38);//
yanshi_100us(1);
write_minling(0x01);//清屏
yanshi_100us(1);
}
void main()
{
chushihua_lcd();
write_minling(0x83);
write_date('k');
write_date('w');
write_date('M');
write_minling(0xc7);
write_date('q');
write_date('D');
write_date('M');
}
请教各位老大 ,这程序为啥一加上清屏命令,就没显示(不管位置和延时),一去掉就一切正常??????
|