第8章键盘输入.pptVIP

  • 4
  • 0
  • 约8.58千字
  • 约 51页
  • 2019-10-17 发布于湖北
  • 举报
矩阵式键盘接口—行动态扫描方法 0 0 0 0 1 0 1 1 矩阵式键盘接口—行动态扫描方法 0 1 1 1 1 1 1 1 矩阵式键盘接口—行动态扫描方法 1 0 1 1 1 0 1 1 键号=行号*每行键数+列号 例4 矩阵式键盘举例 #includereg51.h #define uint unsigned int #define uchar unsigned char uchar code KEY_TABLE[]={ 0xee,0xde,0xbe,0x7e, 0xed,0xdd,0xbd,0x7d, 0xeb,0xdb,0xbb,0x7b, 0xe7,0xd7,0xb7,0x77}; //键盘表 uchar code TABLE[]={0x3F,0x06,0x5B,0x4F, 0x66,0x6D,0x7D,0x07, x7F,0x6F,0x77,0x7c, 0x39,0x5e,0x79,0x71}; //共阴数码管编码表 void delayl() //长延时,作点亮数码管用 {uint n=50000;while(n--);} void delays() //短延时,作消振用 {uint n=10000;while(n--);} main() {uchar temp,key,num,i;

文档评论(0)

1亿VIP精品文档

相关文档