标题: STM32单片机矩阵键盘逻辑写的没有问题,但一直不出功能,求大佬 [打印本页]

作者: xuanchenxing101    时间: 2024-6-13 14:43
标题: STM32单片机矩阵键盘逻辑写的没有问题,但一直不出功能,求大佬
STM32矩阵键盘逻辑写的没有问题,但一直不出功能,求大佬

作者: xxxevery    时间: 2024-6-13 16:28
啥也没有能说啥
作者: heihei51aaaaa    时间: 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.
作者: heihei51aaaaa    时间: 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.

作者: wnk64    时间: 2024-6-13 22:02
不发原理图,不发代码,谁知道你写的啥啊,一个矩阵键盘能需要什么逻辑




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1