当前位置:网站首页>Stm32f1 and stm32cubeide programming example - matrix keyboard driver
Stm32f1 and stm32cubeide programming example - matrix keyboard driver
2022-06-28 12:58:00 【Visual intelligence】
Matrix keyboard driver
1、 Matrix keyboard introduction
Keyboard is an input device widely used in various electronic and embedded projects . They are used to get input in the form of numbers and letters , And input it into the system for further processing .
The matrix keyboard consists of a set of interconnected buttons . In this example, use 4X4 Matrix keyboard , Each of the four lines has 4 Button . The button terminal shall be connected as shown in the figure below . In the first line , all 4 One terminal of each button is connected together ,4 The other terminal of the button represents 4 Each column in the column , The same goes for every line . So there is 8 Root cable to connect a microcontroller .

First , Need configuration 8 individual GPIO Pin . Four of them are input , The other four are output pins . You can then connect the column pins to the input or output pins , But for convenience , I connect them to 4 Two output pins .
Last but not least ,4 The row pins will be connected to the... Of the microcontroller 4 Two input pins . As shown in the figure below :

How to determine which key in the keyboard is pressed ?
1) Find column position
- First , Set all rows to logical level 0, Set all columns to logical level 1.
- Whenever a key is pressed , The columns and rows corresponding to the button will be short circuited , And change the corresponding column to logic level 0. Because the column is connected ( A short circuit ) To be at logic level 0 The line of .
边栏推荐
- The Research Report of Analysys' 2022 China Banking privacy computing platform supplier strength matrix analysis' was officially launched
- 思源官方付费同步使用指南
- Unity webgl mobile end removal warning
- ASP. NET CORE Study06
- async-validator.js數據校驗器
- mysql数据库扫盲,你真的知道什么是数据库嘛
- Beginner level of attack and defense World Hello_ pwn
- pytorch基础
- FineReport安装教程
- 【云原生】自助报表和BI能做这么多事?
猜你喜欢

group_ Concat learning and configuration

ASP. NET CORE Study04
![[today in history] June 28: musk was born; Microsoft launches office 365; The inventor of Chua's circuit was born](/img/bf/09ccf36caec099098a22f0e8b670bd.png)
[today in history] June 28: musk was born; Microsoft launches office 365; The inventor of Chua's circuit was born

fastposter v2.8.4 发布 电商海报生成器

VS2012 VC新建一个空白窗口应用

【历史上的今天】6 月 28 日:马斯克诞生;微软推出 Office 365;蔡氏电路的发明者出生

Matplotlib_Study01

Go语学习笔记 - gorm使用 - 数据库配置、表新增 | Web框架Gin(七)

【MySQL从入门到精通】【高级篇】(三)MySQL用户的创建_修改_删除以及密码的设置

From jsonpath and XPath to spl
随机推荐
哪一个证券公司最好最安全 怎么办理开户最安全
【历史上的今天】6 月 28 日:马斯克诞生;微软推出 Office 365;蔡氏电路的发明者出生
The press conference of Tencent cloud Database & CSDN engineer's ability lightweight certification is coming
在线JSON转PlainText工具
async-validator.js數據校驗器
BUUCTF:[WUSTCTF2020]朴实无华
ASP. NET CORE Study06
k3s一键安装脚本
K3s one click installation script
ASP. NET CORE Study04
Unity releases webgl and wakes up keyboard input on the mobile terminal inputfield
证券账户开户哪家的费率低 怎么办理开户最安全
2022-06-28日报:LeCun最新论文:通往自主机器智能的道路
Vscode如何设置自动保存代码
从pdb源码到frame帧对象
JS duration and asynchronous function promise
[MySQL from introduction to mastery] [advanced part] (III) creation of MySQL users_ Modification_ Delete and password settings
I²C、SMBus、PMBus关系
fastposter v2.8.4 发布 电商海报生成器
Which securities company is the best and safest? How to open an account is the safest