Here’s a wiki friendly write-up of what’s going on, as requested by @wyleu . But it might also need some comments and clarifications from @riban. I’m describing this the way I have it connected now, without considering the matrix connections, which @riban said he’d like to introduce.
Pro Micro (and other Arduino boards) can be used to interface the encoders to Raspberry Pi using I2C protocol, plus act as a USB-MIDI device (this one is true only for ATmega32U4 based boards, such as Micro, Pro Micro and Leonardo)
Here’s how to wire the encoders, Pro Micro and Raspberry Pi, but other boards should follow more or less the same pattern
The encoders and switches should have common ground and connect to Pro Micro pins defined in the code. It’s easy to change pin numbers if you use other board, or want to connect in the other way.
I2C Data and Clock pins are on different pins for each board, for Pro Micro they are pin 2 and 3, and they should be connected to corresponding pins on Raspberry Pi.
Interrupt pin is also defined in code on Pro Micro side and in Zynthian webconf on the Raspberry Pi side. You can change this pins however will fit your setup better. Please note that if your board uses 5V logic signals, you should connect Interrupt using voltage divider, as shown in the diagram (can anybody confirm if using this 10K and 20K is ok? I mean it works for me, but is it the right approach?). Some Arduinos use 3,3V signals, in this case there is no need in resistors, and pins can be connected directly.
Connecting serial port RX and TX pins is needed only if you plan to use Pro Micro as a USB MIDI device. If your board can’t be used as a MIDI don’t connect them.
And connecting VCC and GND is how the board will be powered. If you use other board, check the power requirements for it, you might want to use Raspberry PI’s 3.3v output, or regulated input on your board.
After uploading the code to the board and wiring everything up it’s time to power up the Raspberry Pi, go to webconf and set up the wiring. You can ignore the Encoders B-pins and MCP23017 INT-B Pin fields, only A-Pins matter here.
Here’s a small bonus. If you use board as USB MIDI device, you can rename it, so it will not appear as Arduino Pro Micro in the MIDI devices list
Here’s a sample of bassline from JV/MDA JX10 sequenced from Ableton through USB MIDI while playing with cutoff and resonance using encoders
Also here’s the code that I use at the moment, which actually adds USB MIDI stuff. zynthian-i2c-encoders_usb-to-serial-midi.ino (10.2 KB)
The only problem is that for some reason it transfers everything on one midi channel. I’ll look into fixing it later, and might host it on git, so it’s possible to link to it from wiki