Teensy 4.1 Problem midi controller

Hi everyone, I recently bought a teensy 4.1. I'm building a controller with 11 multiplexers, In the past I had already done such a project and with the help of the forum I managed to make everything work, I went from a thousand wires to pcb panels.
The code of the previous controller doesn't work anymore with the new project.

The problem is that the potentiometers work partially, the direction of rotation inside the daw is wrong (from right to left) also does not make a complete rotation but stops halfway.

I tried to make an analog read, but it doesn't work, the reading remains always on the same number even if I turn the potentiometer.

I also tried with another teensy 4.1 and potentiometer same problem,

I do not know how to go on

Can you help me please

Thanks in advance

Translated with www.DeepL.com/Translator (free version)

this is the code :

#include <Control_Surface.h> // Include the library
 
USBMIDI_Interface midi; // Instantiate a MIDI Interface to use
 
// Install an analog multiplexer
CD74HC4067 mux {
  A0, // Analog input pin
  {2, 3, 4, 5} // Address pins S0, S1, S2
};
 
CCPotentiometer volumePotentiometers[] {
  { mux.pin(0), { MIDI_CC::Channel_Volume, CHANNEL_1 } }
  { mux.pin(1), { MIDI_CC::Channel_Volume, CHANNEL_2 } }
  { mux.pin(2), { MIDI_CC::Channel_Volume, CHANNEL_3 } }
  { mux.pin(3), { MIDI_CC::Channel_Volume, CHANNEL_4 } }
  { mux.pin(4), { MIDI_CC::Channel_Volume, CHANNEL_5 } }
  { mux.pin(5), { MIDI_CC::Channel_Volume, CHANNEL_6 } }
  { mux.pin(6), { MIDI_CC::Channel_Volume, CHANNEL_7 } }
  { mux.pin(7), { MIDI_CC::Channel_Volume, CHANNEL_8 }
};
 
void setup() {
  Control_Surface.begin(); // Initialize the Control Surface
}

void loop() {
  Control_Surface.loop(); // Update the Control Surface
}

For that simply swap over the power and ground to the pot.

Try measuring the pot resistance out of the circuit with a resistance meter and make sure you have identified the wiper correctly.

That doesn't sound right. If you're using a multiplexer, try something like this: Control Surface: 1.AnalogReadSerial.ino

Or if you can, connect the pot directly to the Arduino (without a multiplexer), and use the built-in AnalogReadSerial example.

This is most likely a hardware issue, so keep a multimeter handy as Grumpy Mike suggested.

thanks for the answers,

I tried to measure the potentiometer and everything seems normal, I connected directly the pot without multiplexer but same problem, the port that uses automatically is COM 5, USB : Serial+Midi.

always the same error.

Please elaborate. What did you measure exactly? What voltages did you get between the wiper and ground (when connected to the Teensy)?
Keep in mind that the T4.1 is a 3.3V microcontroller, you'll probably destroy the ADC if you feed it 5V.

Or more likely the sample and hold capacitor in front of the ACD, that would cause all inputs to to do the same thing.

That is completely what would happen if you feed a signal over 5V into an A/D converter with a voltage referencer of 3V3. Make sure the top of your pots is connected to 3V3 and not 5V.

Now it works, the only thing is that the potentiometer comes only up to half.

the vcc of the pot are going in the 3.3V (250 mA) pin.

Can you explain what works now please.

the direction of the potentiometer is correct, and the analog read works with the single potentiometer.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.