找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 106|回复: 4
打印 上一主题 下一主题
收起左侧

STM32单片机矩阵键盘逻辑写的没有问题,但一直不出功能,求大佬

[复制链接]
楼主
ID:1125104 发表于 2024-6-13 18:21 | 显示全部楼层
Many microcontrollers have different locations for accesing the inputs and outputs. For example on ATMEL AVR microcontroler to read or write the logical values to port B you use PORTB. To read the actual phisical value of port B you will need to use PINB. Example: "in r16,PINB" will read the physical bits of port B. This is what you need to use to read the keyboard matrix.
回复

使用道具 举报

沙发
ID:1125104 发表于 2024-6-13 18:25 | 显示全部楼层
Maybe you are reading the logical value of the keyboard matrix i/o port instead of reading the phisical value.

On ATMEL AVR microcontroller, to read the logical value of port b for example you use:
in r16,PORTB

To read the actual phisical value of port b you will use:
in r16,PINB

So, in your matrix keyboard you need to read the physical value (the real value), not the logical value from the port.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表