tttapa / Arduino-Helpers

GNU General Public License v3.0
55 stars 9 forks source link

Data receive from serial monitor, but not on my daw #11

Open bynauy opened 1 month ago

bynauy commented 1 month ago

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

include

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 image but not work on my daw image ohh, and when i move the encoder left o right the arduino led blind

https://github.com/user-attachments/assets/7af7c386-8c10-4faf-a843-a780ece6806c

thanks in advice. keep safe. Juan.

tttapa commented 1 month ago

USBDebugMIDI_Interface midi;

You're using a USBDebugMIDI_Interface, which prints messages to the serial monitor. If you want the controller to actually send MIDI messages, you'll need a USBMIDI_Interface.

bynauy commented 1 month ago

thanks a lot Pieter. a last question, when i move the encoder it works, but sen 0 or 127 how can i do for work betwen values( as potentiometer) i want Select the Arduino as a custom MIDI controller in my DAW, and map it like a normal CC controller (not a relative one). i will really apreciaty if you can helpme, im promiese that i can give you photo and video when all work, it would be a really nice project for me. keep safe. Juan.