单片机教程网

电脑版
提示:原网页已由神马搜索转码, 内容由www.51hei.com提供.
查看:90|回复:4
打印上一主题下一主题

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

[复制链接]
跳转到指定楼层
楼主
ID:1119762发表于 2024-6-13 14:43|只看该作者回帖奖励
STM32矩阵键盘逻辑写的没有问题,但一直不出功能,求大佬
沙发
ID:59202发表于 2024-6-13 16:28|只看该作者
啥也没有能说啥
板凳
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.
5#
ID:1125137发表于 2024-6-13 22:02|只看该作者
不发原理图,不发代码,谁知道你写的啥啊,一个矩阵键盘能需要什么逻辑

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

Powered by 单片机教程网