Open Ertugrulbabaci opened 11 months ago
As I understand it, you are talking about such a scheme.
I don’t understand at all what the circuit will look like if it is divided into two, 8 buttons each. This will be very difficult. And you will need to run 8 wires to your gearbox.
Now there is a diagram in the description where you can do all this using 3 wires. I don't think it makes sense to add buttons on a matrix circuit to the firmware.
Buy 74HC165 shift registers. They are cheap))
The reason I want this system is because I have ready-made connections. And I asked, thinking that maybe there was a suitable scheme in the system you prepared. I don't think about money. Which system can I use the most buttons using the least amount of cables? Which one should I choose?
The reason I want this system is because I have ready-made connections. And I asked, thinking that maybe there was a suitable scheme in the system you prepared. I don't think about money. Which system can I use the most buttons using the least amount of cables? Which one should I choose?
Ok. Well, I don’t think it will be difficult to redo the wires on your assembly. It would be better and more compact. But you can ask @vsulako to do this if he wants. But again, other connection options are much better.
Currently, the firmware does not implement the button connection option that you need.
1) There is no limit for analog pin buttons, you can connect up to 32 buttons to single pin. But, this type of connection can not detect two or more pressed buttons, only one at a time, so it is not a good choice for usual buttons, it can be ok for a shifter, because it selects only one gear per time. 2) Sorry, no button matrix support for now. It required too many pins - 4x4 matrix will take 8 pins. Also, matrix wiring is somewhat messy. I didn't think someone would need it. Will try to add when have some time. 3) I think simplest connection for buttons is with i2c extenders: PCF8575/8574. They are cheap, 4 wires only, no need for extra resistors for every button, no need for chaining, can be arranged in 4x8, 2x8+1x16 or 2x16 layouts.
thanks for the answer. I will try to use 74HC165 shift register for gear (8 buttons). (I hope I can succeed) I will try to make the 8 buttons on the steering wheel with analog button connection. This seems to be the easiest.
thanks for the answer. I will try to use 74HC165 shift register for gear (8 buttons). (I hope I can succeed) I will try to make the 8 buttons on the steering wheel with analog button connection. This seems to be the easiest.
You can do everything on analog buttons or everything on registers. Just keep in mind that you won't be able to press multiple buttons on an analog connection. Analog buttons are more suitable for gearboxes.
Added support for button matrix. configuration:
#define BM //uncomment to enable
#define BM_COL_PINS 2,3,4 //pins for columns, comma-separated
#define BM_ROW_PINS 5,6,7 //pins for rows
#define BM_1ST_BTN 1 //number of first button (1-32)
Thank you very much. I think the other methods you mentioned make more sense. If I fail to do so, I will go back to the matrix link.
Hellı again. I'm trying to make a connection using the analog button method. I made the button connections with 4.7k resistors. I cannot assign buttons because I cannot see the values. How can I see the values? Also, can I use both analog connection and shift register at the same time?
apbout
. It will turn on outputting value from analog pin selected in config. (#define APB
must be uncommented and APB_PIN
defined)Okay, I took care of the analog buttons. I decided to use matrix connection instead of shift register for gear, but I could not understand the pin connections in the matrix codes. 234 567 says 6 pins in total, but 8 cables are needed for 16 buttons. Should I make the connection according to the diagram in the picture above?
You say you already have button matrix.
With 16 buttons it should have 8 pins, 4 for rows and 4 for columns. Internal connections should be like on a picture above.
You need 8 free pins on arduino. I dont know which you have, but say for example, they are 2,3,4,5,6,7,A4,A5.
Just list them in config separated by commas, columns and rows pins separately.
#define BM //enable
#define BM_COL_PINS 2,3,4,5
#define BM_ROW_PINS 6,7,A4,A5
#define BM_1ST_BTN 1
And connect to your button matrix accordingly.
Usually rows/cols pins are interchangeable, but sometimes matrix can have diodes inside, to prevent ghosting. If if does not work, try to swap columns/rows pins (diode's cathode should be at row's pin)
I've been trying to find where the problem is for hours. I was connecting the buttons but it wasn't working. You have uploaded a new ino file. I was trying to write the Matrix code myself. When I downloaded the new ino file, my problem was solved. thanks a lot.
Hi bros again. After giving direction with hatswitches, can we add a button that we can use instead of backspace(actually ESC) and enter? Is the button code available? @vsulako
For example, you entered the settings tab in the menu. I meant a button you can use when you want to go back to the main menu tab. Like the X and O buttons on the playstation controller. Is this possible?
Game should allow to define which controller button does actions like navigating in menus.
If not, just use a mapper to map buttons to esc/backspace/enter/whatever.
Hello. How many buttons can I connect to a single pin in the analog button connection? I want to use 4x4 matrix button connection (8 for gear and 8 for steering wheel). Also, are resistors necessary?