- 3
- 0
- 约4.17千字
- 约 12页
- 2017-06-08 发布于河南
- 举报
根据扫描键盘返回的键值编码查键值编码表(国外英文资料)
根据扫描键盘返回的键值编码查键值编码表(国外英文资料)
According to the key value returned by the scanning keyboard, the key code table is searched to obtain the key value and send to the digital tube display.
When you turn on the machine, the digital tube shows -.
When the key is pressed, the digital tube shows the key value of the press key, and the buzzer rings. *?
#include? reg52.h?
#include? intrins.h?
#define? Uchar? Unsigned? Char?
#define? Uint? Unsigned? Int?
Sbit BEEP = P3^6;????? / / buzzer drive line
Sbit? L1=P2^0?;
Sbit? L2=P2^1????????????
Uchar, a, B, C, num;
Uchar? Key?;
Unsigned? Char? Code? Disp_code[]={?
????, 0x3f, 0x06,0x5b, 0x4f, 0x66,0x6d, 0x7d, 0x07,
?????????????? 0x7F, 0x6f, 0x77,0x7c, 0x39,0x5e, 0x79,0x71,0x40};??? / / common cathode
/*unsigned? Char? Code? Disp_code[]={?
????????? 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8?,
?????????????? 0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e, 0xbf}; * /???? / / Yang
Unsigned? Char? Code? Key_code[]={?
???, 0xEE, 0xde, 0xbe, 0x7e, 0xed, 0xdd, 0xbd, 0x7d?
???, 0xeb, 0xdb, 0xbb, 0x7b, 0xe7,0xd7,0xb7,0x77}?;
Void? Display (uchar, key)?;
/oid, delay (void);
/**********************************************************?
Timer T0
**********************************************************/?
Void, init ()
{
TMOD=0x01;
TH0= (65536-4000) /256;
TL0= (65536-4000)%256;
EA=1;
ET0=1;
TR0=1;
}
Void, timer0 (), interrupt? 1?
{
TH0= (65536-4000) /256;
TL0= (65536-4000)%256;
Num++;
}
/**********************************************************
Delay sub function
**********************************************************/
Void, delayms (uint, MS)?
{
What? Uchar? T?;
While? (ms--)?
??? {?
For? (t = = 0, t, 120, t++);
???}
}
/*void, delay (void)
{
Unsigned? Int? I=0?;
For? (i=0; i5300; i++) {}
* /}?
/**********************************************************
X*0.14MS, delay, sub function
**********************************************************/
Void, delay0 (uchar, x)????
{
What? Uchar? I?;
While? (x--)?
?? {?
What? - for? (I = = 0, i13? I++) {{}
???}
}
您可能关注的文档
最近下载
- 施工质量日志-.xls VIP
- 2025年国家公务员全国总工会面试题及答案.docx VIP
- 中国血栓性疾病防治指南(2025版).docx VIP
- 合肥市普通高中六校联盟2025-2026学年高三第一次语文教学质量监测+答案.docx VIP
- 局部晚期食管癌患者新辅助免疫治疗与常规新辅助治疗的比较:系统评价和meta分析.pdf
- 2025以骑手为代表的新就业群体研究报告:职业技能与跑单时长对收入的共同作用.pdf VIP
- 年产一亿片别嘌呤醇的车间工艺设计.doc VIP
- 商务型(带电梯、地下室、效果图)三层别墅设计图.pdf VIP
- 2026年详版个人信用报告征信报告最新Word可编辑模版样板doc文件.docx
- 2026年春接力版(新教材)小学音乐一年级下册(全册)教学设计(附目录P160).docx
原创力文档

文档评论(0)