Guten Abend,
ich habe eine art Gameboy mit nem Pi 3 und Retropie gebaut und nutze eine 4x5 Buttonmatrix.
Leider kann ich trotz Sperrdioden die Buttons die auf einer Zeile liegen nicht gleichzeitig benutzen.
Zb. nach links laufen(A2) und gleichzeitig springen(B2).
mein Code:
Code
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@1 {
target = <&gpio>;
__overlay__ {
keypad_pins: keypad_pins {
brcm,pins = <5 6 12 13 16 19 20 21 26>;
brcm,function = <0>; // input
brcm,pull = <1>; // 0=off, 1=down, 2=up
};
};
};
fragment@0 {
target-path = "/";
__overlay__ {
keypad: matrix4x5 {
compatible = "gpio-matrix-keypad";
pinctrl-names = "default";
pinctrl-0 = <&keypad_pins>;
debounce-delay-ms = <5>;
col-scan-delay-us = <2>;
/*
try to use GPIO only lines
to keep SPI and I2C usable
*/
row-gpios = <&gpio 6 0 // 1
&gpio 26 0 // 2
&gpio 13 0 // 3
&gpio 19 0>; // 4
col-gpios = <&gpio 16 0 // 5
&gpio 12 0 // 6
&gpio 21 0 // 7
&gpio 20 0 // 8
&gpio 5 0>; // 9
/*
Keycodes from /usr/include/linux/input-event-codes.h
converted to hex using printf '%02x\n'
*/
linux,keymap = <
// row1 colA KEY_UP 103
0x00000067
// row2 colA KEY_LEFT 105
0x01000069
// row3 colA KEY_RIGHT 106
0x0200006a
// row4 colA KEY_DOWN 108
0x0300006c
// row1 colB KEY_X 45
0x0001002d
// row2 colB KEY_Y 21
0x01010015
// row3 colB KEY_A 30
0x0201001e
// row4 colB KEY_B 48
0x03010030
// row1 colC KEY_U 22
0x00020016
// row2 colC KEY_I 23
0x01020017
// row3 colC KEY_O 24
0x02020018
// row4 colC KEY_P 25
0x03020019
// row1 colD KEY_H 35
0x00030023
// row2 colD KEY_J 36
0x01030024
// row3 colD KEY_K 37
0x02030025
// row4 colD KEY_L 38
0x03030026
// row1 colE KEY_C 46
0x0004002e
// row2 colE KEY_V 47
0x0104002f
// row3 colE KEY_N 49
0x02040031
// row4 colE KEY_M 50
0x03040032>;
};
};
};
};
Alles anzeigen
meine Buttonmatrix:
Ich hoffe es kann mir Jemand helfen.