My first post here, so if this in in the wrong area - I apologise
.
I have a Due setup in keyboard emulation with a few buttons working more or less fine (windows 10 doesn't like it on certain USB ports).
I'd like to add an FS3x (3 button stomp box made by Digitech) as an extra set of 3 buttons. The FS3x is connected via a Stereo (TRS - 3 conductor only) cable.
I know I could make my own enclosure with as many switches as I want, but I'd like to try and use what I have easily available for a few reasons, not worth going into here.
This is a wiring diagram for a work-alike fs3x, to help understand what is going on at the switch end of things.
I'm currently using (more or less) the wiring setup described here for my project (https://www.arduino.cc/en/Tutorial/KeyboardAndMouseControl)
If anyone can help me work out what I need to do on my Due side of things so I can add a TRS socket to my Due/enclosure and run a TRS cable to the FS3x and add an extra 3 buttons easily, it'd be greatly appreciated.
Beyond setting up the wiring without frying my Due, what would I need to do to my code to get the 3 switches working independently?
Based on how I read the diagram for the footswitch, I believe the FS3x will send a signal to 1 pin when a certain button is pressed, the 2nd pin for the 2nd button and both pins if the 3rd is pressed. Based on that, I think I'd need to do something like what I list below, but I don't know if Arduino can handle code along the lines of;
while (digitalRead(4) == LOW) {
and
while (digitalRead(6) == LOW) {
delay(10);
Keyboard.press(blahblahblah);
If I'm reading it wrongly, or the Due can't accept that kind of code, could a wiring method (with some combination of diodes perhaps) be used to take the 3 conductors of the TRS and make it into 4 (ground and 3 pins) for the Due?
Any help or advice that could be offered will be received gladly.