Good luck on the continuing bug-hunt
Thanks. I hope we solved it with that delay.
OK, let me paraphrase your situation. You have 4 combinations and have only reported on two.
You send a signal from pin11 to pin12, and use pin13/LED to verify it comes through. This works if the connection is very close (Why did you use a diode? What do you think happens if you reverse the diode? I think it will "fail"). You do not say if things work as expected if you do not connect the two.
This fails if you have long wires which go "somewhere", claiming there is a connection although your Ohm meter says they have no connection. (Somewhere is a switch matrix, or circuit or ?) Does it work as expected if the switchmatrix-circuit-whatever is closed?
Sorry. With nothing connected, the LED doesn't blink. Just as expected. With the pinball wires connected and the switch closed, it blinks as expected. At least when it's the first switch to be tested. If not, the first switch which is open sometimes yields a "closed".
The reason I used a diode is because there has to be a diode connected in series with every switch in the matrix, or else the matrix will let through false positives. And I wanted to simulate the connection as faithful to the original as possible. I didn't believe it, but I though that maybe, maybe the voltage loss over the diode would be enough to keep the input of pin12 HIGH.
A reversed diode on the stripped down test will only lead to fail to let the signals through form pin11 to pin12.
A reversed diode in the switch matrix would lead to both fail to let through the correct signals and let false signals go to backwards through a closed switch and thus yield false positives while testing some of the other switches in the matrix.
Have you tried delayMicroseconds(100), (50), .. (four is the minimum)?
No, that's a new keyword for me. I will keep it in mind for the final fine-tuning.
You code without the delay will turn the pin on and sample it on/off the other approximatly 300-500 nanoseconds later (I have not worked out the precise timing) or 15 meters at lightspeed. Any capacitance/inductance will drastically reduce the speed.
Wow! That's totally amazing. Really hard to believe. (But of course I do believe you!)
Lastly what makes it "scan one set of switches on LOW and another on HIGH"? A circuit? Diode? Relay?
Originally, it was a 7445 BCD To Decimal Decoder. But it is fried, so I built a new multiplexer. While hunting the bugs, I even skipped that one to eliminate potential error sources. (The bug persisted anyway, because it appears to be due to the long wires in combination with the speed of the Arduino.) But I just decided to skip the home-made multiplexer anyway; the Arduino Mega will have more than enough pins to handle that multiplexing itself.
Thanks again for all the input, hints and encuoragement.
/SimLego