Hey all, I'm wondering if someone can help me with coding a Pro Micro for a Button Box project?
I've tried Fiverr but nobody seems to understand the whole PC button box thing so I'm getting nowhere. =(
I have a schematic with exact button placement, hopefully I got the matrix correct.
27 button inputs (1 on encoder) and 1 rotary encoder input.
< is an on-off-on switch. (momentary)
/ is an on-off toggle switch. (momentary)
I've found code online but it was for 25 buttons and 4 encoders. I know nothing about coding.
I'm more than happy to pay someone for their time and help.
The matrix is just a blank box with no pin numbers so it is imposable to tell if it is wired up correctly. You have no diodes in that circuit so it can only handle one button being pressed at any one time. So the switches you have in the matrix are connected up then that will stop you being able to read it. Sticking a rotary encoder in the middle of a matrix is not very clever, as you will not be able to constantly monitor it like you need to.
You might consider posting a schematic in place of the incomplete frizzy picture. Also links to the technical information on the hardware. Start by using just part of the keyboard with some of the code you found. Get that much working then add code to add additional buttons. By the time you have it working you will also understand it.
Apologies and thanks for yout input, I should have given more info.
As far as I'm aware from studying other matrixes online, it is correct in it's layout.
Only the button function of the encoder is linked to the matrix so it shouldn't be an issue, as the rotary function is separated.
All buttons & switches are momentary or spring return so shouldn't require diodes and no 2 buttons are press at the same time.
I'm learning as I go with this so I'll try and figure out the matrix pinout.
The code i found is from the AMSTUDIO button box on YouTube.
Sorry Gil, it's not fuzzy at all on my screen but here's an updated one.
As reply above, all switches & buttons are momentary and not latching.
I found a joystick library with some instructions so i might give it a try as you suggest.
That is rather naive, it will happen, and it is not as if the diodes are expensive, about $0.04 each.
Given that you are the one asking the questions and I am doing the answering, and I have been in electronics over 50 years, have 6 books published and written over 400 magazine published articles about interfacing, who knows most about this subject?
The matrix needs a diode in series with each switch on each intersection. Here is a simple 3 by 4 switch matrix. The Columns in this diagram go into a decoder / demultiplexer chip to save on the number of processor pins you use, but in your application you can omit this chip and just connect the to Nano.
This also shows the walking zero pattern you need to generate on the column outputs in order to read the matrix. Also note that this diagram has the rows as inputs and the columns as outputs. You can make a matrix the other way round with the columns as inputs and the rows as outputs, but you will need some pull up resistors with that configuration.
Gill is referring to the type of schematic you are producing. It is similar in style to the Frtizing physical layout diagrams that are utterly useless when trying to design a circuit. Notice my diagram is how a schematic should look. It removes any physical details so you can concentrate on what the circuit is and how it works. This is how anybody who knows the slightest bit of electronics expresses circuits. Your use of a physical layout diagram with incorrect symbols for your switches marks you out as an absolute beginner. Also those toggle switches you showed in the diagram are of two different types of switch the first three being a three position switch and the second could possibly be what you describe them as, that is a spring return switch.
All good, thanks for the reply. I am pretty much a beginner, hence offering paid help.
I've only used premade LeoBodnar boards in the past. I've been trying to research and my drawings are pretty much copy paste off other boxes I've seen on forums and YouTube, (AMSTUDIO) none of which have used diodes so sorry for my ignorance on this.
All my switches are momentary, none are latching, including the toggle switches, both the on-off-on (3 on the left) and on-off (2 on the right) are self return to off position.
Appreciate the feedback and I'll do a bunch more research on the topics.
I'll close this thread soon to prevent more of my confusion as someone has offered to help with both the wiring schematic and coding the Pro Micro.
Again, thanks for your input Grumpy and I do apologize for both my misinformation and confusion, you've actually given me a lot of insight and info to research. =)
Grumpy_Mike has it correct. In addition I do not see where the Black, Yellow and Green lines connect to. There are many schematic capture programs available for the downloading. Some are limited others are not. I use KiCad which allows me to go from schematic capture to a completed PCB.