key.h
来自「2010年新增TX-1C程序」· C头文件 代码 · 共 43 行
H
43 行
/******************************************************************
本程序只供学习使用,未经作者许可,不得用于其它任何用途
欢迎光临天祥电子 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;//s6,s7,s10,s11,s14,s15,s;
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 + =
减小字号Ctrl + -
显示快捷键?