#include <reg51.h>
#include <Intrins.h>
#define DATA P0 //1602 驱动端口
sbit RS=P2^0;
sbit RW=P2^1;
sbit E=P2^2;
sbit KA=P2^7;
int Pre_KeyNo=16,KeyNo=16;
void delayMs( int x);
void Keys_Scan();
void Busy() //LED 液晶是否忙碌
{
DATA = 0xff;
RS = 0;
RW = 1;
while(DATA & 0x80)
{
E = 0;
E = 1;
}
E = 0;
}
//LED 写指令程序
void WriteCommand(unsigned char btCommand)
{
Busy();
RS = 0;
RW = 0;
E