根据扫描键盘返回的键值编码查键值编码表(国外英文资料).docVIP

  • 3
  • 0
  • 约4.17千字
  • 约 12页
  • 2017-06-08 发布于河南
  • 举报

根据扫描键盘返回的键值编码查键值编码表(国外英文资料).doc

根据扫描键盘返回的键值编码查键值编码表(国外英文资料)

根据扫描键盘返回的键值编码查键值编码表(国外英文资料) 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++) {{} ???} }

文档评论(0)

1亿VIP精品文档

相关文档