此代码所用的模块化编程文件在目录下另一篇文章
此代码为c语言在keil v5软件在(STC89C52)开发板的应用
#include <REGX52.H>
#include "Delay.h"
#include "MatrixKey.h"
#include "LCD1602.h"
/*
´Ë´úÂëÔÚSTC89C52¿ª·¢°åʵÏÖ£º
ͨ¹ý°´ÏÂ4X4¾ØÕó¼üÅ̵ÄÏàÓ¦°´Å¥
ÔÚÒº¾§ÆÁÉÏÏÔʾ¶ÔÓ¦¼üÂë
ÀýÈ磺°´ÏÂS9°´Å¥ ÔòÒº¾§ÆÁÏÔʾ£º
KKeyNum:
09
*/
unsigned char KeyNum;
void main()
{
LCD_Init();
LCD_ShowString(1,1,"KeyNum:");
while(1)
{
KeyNum=Matrixkey();
if(KeyNum)
{
LCD_ShowNum(2,1,KeyNum,2);
}
}
}