I’ve built a 32 note keyboard for tuning a midi pipe organ, not to play just to help with tuning, all the midi side is working fine, but I need 40 keys not 32. As I’ve used a 74hc757 shift register its simple to add more keys so its all set up to play 40 keys and all I have to do is switch between two pins with a switch to get another 12 keys that works fine, not the best way to do it I know. So I started programming a push button to drive a small changeover relay to do the job all good but still not the best way.
My question is can one switch pin inputs with a pushbutton with Arduino?
I can have one bank of switch returns from the keyboard on Arduino pin7 and the other on pin8, I use pin2 for the button that can operate a relay on pin13 (HIGH). I would like the button on pin2 to switch pin7 to pin8 and stay till the button is pressed again (LOW) switching pin8 back to pin7 like the relay or switch will.
Any help please.