基于protues矩阵键盘c程序

上传人:wt****50 文档编号:35357470 上传时间:2018-03-14 格式:DOC 页数:3 大小:50KB
返回 下载 相关 举报
基于protues矩阵键盘c程序_第1页
第1页 / 共3页
基于protues矩阵键盘c程序_第2页
第2页 / 共3页
基于protues矩阵键盘c程序_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《基于protues矩阵键盘c程序》由会员分享,可在线阅读,更多相关《基于protues矩阵键盘c程序(3页珍藏版)》请在金锄头文库上搜索。

1、#include #define keyp P1 #define uchar unsigned char sbit p20=P20; sbit p21=P21; sbit p22=P22; sbit p23=P23; sbit p24=P24; sbit p25=P25; sbit p26=P26; sbit p27=P27; sbit p30=P30; sbit p31=P31; sbit p32=P32; sbit p33=P33; sbit p34=P34; sbit p35=P35; sbit p36=P36; sbit p37=P37; unsigned char keyv=0xff

2、; uchar keys(void); void keyaa(void); void delay(int n) int i,j; for(i=0;in;i+) for(j=0;j100;j+); void main(void) keyv=0xff; do if(keyv!=0xff) keyaa(); keyv=0xff; keyv=keys(); while(1); uchar keys(void)uchar readk,rereadk;uchar xtemp,ytemp;keyp=0x0f;xtemp=keypif(xtemp=0x0f)return (0xff);keyp=0xf0;yt

3、emp=keypreadk=xtemp|ytemp; delay(10);keyp=0x0f;xtemp=keypif(xtemp=0x0f)return (0xff);keyp=0xf0;ytemp=keyprereadk=xtemp|ytemp;if(readk=rereadk)return(rereadk); return(0xff); void keyaa(void) switch(keyv) case 0x11: p20=0;delay(50);p20=1; break; case 0x21: p21=0; break; case 0x41: p22=0; break; case 0

4、x81: p23=0; break; /第一行、 、case 0x12: p24=0; break; case 0x22: p25=0; break; case 0x42: p26=0; break; case 0x82: p27=0; break; /第二行、 、case 0x14: p30=0; break; case 0x24: p31=0; break; case 0x44: p32=0; break; case 0x84: p33=0; break; /第三行、 、case 0x18: p34=0; break; case 0x28: p35=0; break; case 0x48: p36=0; break; case 0x88: p37=0; break; /第四行、 、default:break;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号