单片机原理与接口期末总复习解释.pptVIP

  • 13
  • 0
  • 约1.29万字
  • 约 71页
  • 2016-12-03 发布于湖北
  • 举报
P1=0xfb; switch(P1) {case 0xeb:key=8;break; case 0xdb:key=9;break; case 0xbb:key=10;break; case 0x7b:key=11;break; } P1=0xf0; while(P1!=0xf0) ;//等待按键释放 } } return(key); } P1=0xf7; switch(P1) { case 0xe7:key=12;break; case 0xd7:key=13;break; case 0xb7:key=14;break; case 0x77:key=15;break; } unsigned char scan_key() //键盘扫描 { unsigned char hang,lie; P1=0x0f; //列线输出低电平 if(P1!=0x0f) delay(10); if(P1!=0x0f) { switch(P10x0f) //检测行号 { case 0x0e:hang=0;break; case 0x0d:hang=1;break;

文档评论(0)

1亿VIP精品文档

相关文档