📄 key.h
字号:
/******************************************************************
本程序只供学习使用,未经作者许可,不得用于其它任何用途
欢迎光临天祥电子 www.txmcu.cn
*******************************************************************/
#ifndef __KEY_H__
#define __KEY_H__
#include <at89x52.h>
#include "MyType.h"
extern volatile uint8 idata KeyCurrent,KeyOld,KeyNoChangedTime;
extern volatile uint8 idata KeyPress;
extern volatile uint8 idata KeyDown,KeyUp,KeyLast;
extern volatile uint8 KeyCanChange;
void InitKeyboard(void);
#define KeyIO P1
//获取按键值的宏。由于开关按下为0,所以对结果取反
#define GetKeyValue() (~KeyIO)
#define KEY1 0x01
#define KEY2 0x02
#define KEY3 0x04
#define KEY4 0x08
#define KEY5 0x10
#define KEY6 0x20
#define KEY7 0x40
#define KEY8 0x80
sbit lcden=P3^4;
sbit rs=P3^5;
sbit rxd=P3^0;
sbit txd=P3^1;
sbit csda=P3^2;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -