初学单片机,求大神指导
#include<reg51.h>
#include"lcd.h"
#define GPIO_KEY P1
unsigned char KeyValue;
unsigned char KeyState;
unsigned char dat[]="0123456789ABCDEF";
unsigned char a[6]={0,0,0,0,0,0};
void Delay10ms();
void KeyDown();
//主函数
void main(void)
{
unsigned char i;
LcdInit();
KeyState=0;
while(1)
{
KeyDown();
if(KeyState)
{
KeyState=0;
for(i=0;i<6;i++)
{
a[i+1]=a[ i];
}
a[0]=KeyValue;
LcdWriteCom(0x80+0x40);
LcdWriteData(KeyValue+0x30);
}
}
}
//结果是按键按下,屏幕没反应,求大神
|