I made a midi footswitch with an arduino Pro Micro that worked fine, until I added a TRS input for an expresion pedal.
It doesn't work as intended, because when i turn the pedal to it's zero position the device disconnects. Also it kinda works erraticaly when it's not in zero position.
Don't know what is the problem.
Here it's the code
#include <Encoder.h>
#include <Control_Surface.h> // Include the Control Surface library
// Instantiate a MIDI over USB interface
USBMIDI_Interface midi;
CCButtonLatched buttons[] {
{ 2, 0x10,0 },
{ 3, 0x11,1 },
{ 4, 0x12,2 },
{ 5, 0x13,3 },
{ 6, 0x14,4 },
{ 7, 0x15,5 },
};
CCPotentiometer potentiometer = {
A0, {MIDI_CC::Expression_Controller, CHANNEL_1}
};
void setup() {
// put your setup code here, to run once:
Control_Surface.begin(); // Initialize the Control Surface
}
void loop() {
// put your main code here, to run repeatedly:
Control_Surface.loop(); // Update the Control Surface
}
I'm using and arduino ProMicro, the 5v version. The TRS input is as it follows: The tip goes to 5v, ring to A0 and sleeve to GND.
So I definitely fucked something up, because now the buttons don't work as intended. The expresion pedal works fine, but the buttons only work to turn off what i assign in the DAW.