74HC165按键扫描
贴上百度百科74HC165的基本信息
我们的方案是采用两个165芯片级联,读取16个按键信息
1 UINT8 HAL_Btn_Read74HCT165(void) 2 { 3 UINT8 i; 4 UINT16 ret=0; 6 KEY_SE_CLR; 8 KEY_SE_SET; 10 ret |= KEY_QH_READ; 12 for(i=0; i<15; i++) 13 { 14 ret <<= 1; 16 KEY_CLK_SET; 18 CD74HC165_Delay(); 20 KEY_CLK_CLR; 22 ret |= KEY_QH_READ; 23 } 25 return ret; 26 }
参考:
1.http://www.elecfans.com/yuanqijian/yinjiaotu/20180202628718_2.html
2.https://blog.csdn.net/k1ang/article/details/87898554
本文来自博客园,作者:xjxcxjx,转载请注明原文链接:https://www.cnblogs.com/xjxcxjx/p/15724169.html,谢绝CSDN转载!