Hello arduino hive.!
I have been using this forum for a few years now and have usually found answers to the simple problems I have had but now I'd like some specific feedback, hence the first post!
I want to send key strokes to a computer from my Arduino Mega.
Why not use an arduino with built in USB serial, like the pro micro or Leonardo?
Because I already have an Arduino Mega and that would be too easy otherwise. Well maybe if this all turns out to be too much effort I'll just buy another Arduino.
But bear with me. I have an old table calculator, the kind that prints out a docket and I want to use this to send the key strokes. I have already gutted it and am using the existing key matrix to receive all the keys. Exactly like one of those little 3x4 keypads only cooler.
It uses a 10x10 matrix hence the Mega. I didn't plan on sending keystrokes to the computer at the start of this project otherwise I would have just bought a Due... the one that looks like a mega but has the usb capabilities.
But what I do have is an old usb keyboard! Broken down it's just a tiny pcb with a 26 pin button matrix. Now I have soldered wires to the 26 pins and have mapped the columns and rows and all the keys! When I touch a row wire with a column wire I get a keypress. Awesome that was easy.
Now get the arduino to touch the right wires together when I press the keys on the old calculator and we are away!
This is where I'm at. I have enough digital pins left on the Mega and thought I could get something working.
Here's what I tried. By setting the pins as output and then to low I can use this as a switch to connect the wires of the button matrix. For example pin 40 and pin 41 combination will press the button H. Normally is pin 40 high and 41 low. When I press a button on the calculator both pins go to low, effectively connecting them right? Well it works and I get a key press.
The problem is when I use more and more pins. Because they all end up being connected unintentionally either bot high or low and that gives me multiple presses.
My thoughts are now, is this somehow possible with my current setup or do I have to spend more money. I feel like I'm super close. Maybe an idea to use optocouplers or something to do the switching but then just buy a new board right?
Would be interested to hear your thoughts!