-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Hi, i follow the instrucctions that i found on this library, sorry for the big hyper noob question, but when i move my encoder the serial monitor showing data, but, when i saw my day it dindt work. i have and arduino pro micro buying on aliexpress and bassically work.
here is my code.
#include <Wire.h>
#include <Control_Surface.h>
#include <AH/Hardware/MCP23017Encoders.hpp>
// Type for the MCP23017 encoders (translates encoder pulses to position)
using WireType = decltype(Wire); // The type of I²C driver to use
using EncoderPositionType = uint8_t; // The type for saving encoder positions
using MCPEncoderType = MCP23017Encoders<WireType, EncoderPositionType>;
// Type for the MIDI encoders (translates position to MIDI messages)
struct CCMCPEncoder : GenericMIDIRotaryEncoder<MCPEncoderType::MCP23017Encoder,
RelativeCCSender> {
CCMCPEncoder(MCPEncoderType::MCP23017Encoder enc, MIDIAddress address,
int16_t multiplier = 1, uint8_t pulsesPerStep = 4)
: GenericMIDIRotaryEncoder(std::move(enc), address, multiplier,
pulsesPerStep, {}) {}
};
USBDebugMIDI_Interface midi;
// Create an object that manages the 8 encoders connected to the MCP23017.
MCPEncoderType enc {Wire, 0x0, 7};
// │ │ └─ Interrupt pin
// │ └────── Address offset
// └──────────── I²C interface
// Instantiate 8 MIDI rotary encoders.
CCMCPEncoder ccencoders[] {
{
enc[0], // The encoder to use
MCU::V_POT_1, // The MIDI address
1, // Encoder speed multiplier
4, // Number of pulses per physical "click" of the encoder
},
{enc[1], MCU::V_POT_2},
{enc[2], MCU::V_POT_3},
{enc[3], MCU::V_POT_4},
{enc[4], MCU::V_POT_5},
{enc[5], MCU::V_POT_6},
{enc[6], MCU::V_POT_7},
{enc[7], MCU::V_POT_8},
};
void setup() {
Control_Surface.begin();
Wire.begin(); // Must be called before enc.begin()
Wire.setClock(800000);
enc.begin(); // Initialize the MCP23017
}
void loop() {
enc.update();
Control_Surface.loop();
}
its the same code as follow for mcp23017 encoders, just change the input pin to 7.
it receive data

but not work on my daw

ohh, and when i move the encoder left o right the arduino led blind
WhatsApp.Video.2024-10-20.at.9.49.54.PM.mp4
thanks in advice.
keep safe.
Juan.