Control-Surface icon indicating copy to clipboard operation
Control-Surface copied to clipboard

Encoder over bluetooth on esp32

Open rp1231 opened this issue 3 years ago • 0 comments
trafficstars

Hi, I'm trying to use my esp32 as a bluetooth midi device with a rotary encoder.

Here is the code I've cobbled together by going through the documentation:

#include <Control_Surface.h>
//#include <MIDI_Interfaces/BluetoothMIDI_Interface.hpp>

// ----------------------------- MIDI Interface ----------------------------- //
// ========================================================================== //
 
// Instantiate a MIDI interface to use for the Control Surface.
BluetoothMIDI_Interface midi;

// Instantiate a CCRotaryEncoder object
CCRotaryEncoder enc {
  {15, 16},       // pins
  MCU::V_POT_1, // MIDI address (CC number + optional channel)
  1,            // optional multiplier if the control isn't fast enough
};



// --------------------------------- Setup ---------------------------------- //
// ========================================================================== //
 
void setup() {
  RelativeCCSender::setMode(relativeCCmode::MACKIE_CONTROL_RELATIVE);
  Control_Surface.begin(); // Initialize Control Surface
}
 
// ---------------------------------- Loop ---------------------------------- //
// ========================================================================== //
 
void loop() {
  Control_Surface.loop(); // Refresh all elements
}

I can detect and connect the esp32 via bluetooth but it doesn't get detected as a midi device.

What am I doing wrong here?

Thanks

rp1231 avatar Apr 16 '22 13:04 rp1231