完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
|
|
相关推荐
1 个讨论
|
|
|
uchar keyscan()
{ P3=0xfe; temp=P3; temp=temp&0xf0; while(temp!=0xf0) { delay(5); temp=P3; temp=temp&0xf0; while(temp!=0xf0) { temp=P3; switch(temp) { case 0xee:num=0; break; case 0xde:num=1; break; case 0xbe:num=2; break; case 0x7e:num=3; break; } while(temp!=0xf0) { temp=P3; temp=temp&0xf0; } } } P3=0xfd; temp=P3; temp=temp&0xf0; while(temp!=0xf0) { delay(5); temp=P3; temp=temp&0xf0; while(temp!=0xf0) { temp=P3; switch(temp) { case 0xed:num=4; break; case 0xdd:num=5; break; case 0xbd:num=6; break; case 0x7d:num=7; break; } while(temp!=0xf0) { temp=P3; temp=temp&0xf0; } } } P3=0xfb; temp=P3; temp=temp&0xf0; while(temp!=0xf0) { delay(5); temp=P3; temp=temp&0xf0; while(temp!=0xf0) { temp=P3; switch(temp) { case 0xeb:num=8; break; case 0xdb:num=9; break; case 0xbb:num=10; break; case 0x7b:num=11; break; } while(temp!=0xf0) { temp=P3; temp=temp&0xf0; } } } P3=0xf7; temp=P3; temp=temp&0xf0; while(temp!=0xf0) { delay(5); temp=P3; temp=temp&0xf0; while(temp!=0xf0) { temp=P3; switch(temp) { case 0xe7:num=12; break; case 0xd7:num=13; break; case 0xb7:num=14; break; case 0x77:num=15; break; } while(temp!=0xf0) { temp=P3; temp=temp&0xf0; } } } return num; } 这样就不冲突啦,每按一个键返回num值 |
|
|
|
|
|
|
|
506 浏览 0 评论
607 浏览 0 评论
837 浏览 0 评论
832 浏览 0 评论
RT-Thread与英飞凌(infineon)合作得板子PSOC 6 板子学习
768 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
17058 浏览 31 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-14 10:11 , Processed in 0.689561 second(s), Total 40, Slave 32 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
5785