Teensy 2.0 can't get 3 Expression Pedals working

Status
Not open for further replies.

miasei

Member
I made a Midi Foot Switch and made 3 inputs for Expression Pedals. 2 of them are on A0 and A1. I used Midi learn. They show up 16 and 17 as midi message. But the third expression pedal is not working properly. It depends where the pedal position is. It is showing 16, 17 or 18. And there is a delay. Can somebody help me. I checked the soldering twice. Thanks
 
Post a photo of the connections to the Teensy2.
What is Midi learn?

It is showing 16, 17 or 18
What is "It"? Where does this show? If you are referring to pin numbers then A0 is pin 21, A1 is pin 20 and A2 is pin 19.

Pete
 
Sorry for the bad description. I am sending Midi CC messages to a software. For A0 I definded 16 as a number. For A1 17 for the control number and A2 should be 18 but when I move the pedal it toggles between 16, 17 and 18. Here is a pic how it is soldered. Checked it twice. Screenshot_20210820-080629.jpg
 
Last edited:
@miasei - your diagram has two of the connectors of P3 PIN going to the same row, they should be as you have the first two, going to different connection points. If truely wired this way, you have both going to ground or whatever.
 
Here is the code. I use the Control Surface library.

Code:
#include <Wire.h>
#include <hd44780.h>                       // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header

//hd44780_I2Cexp lcd; // declare lcd object: auto locate & auto config expander chip

hd44780_I2Cexp lcd1(0x27);
hd44780_I2Cexp lcd2(0x26);

const int LCD_COLS = 16;
const int LCD_ROWS = 4;


#include <Control_Surface.h> // Include the Control Surface library
 
USBMIDI_Interface midi; // Instantiate a MIDI over USB interface.
 
// Instantiate an array of CCButton objects that send MIDI control
// change messages whenever the button is pressed/released
CCButton buttons[] {
  {0, 85}, // button pin number, controller number
  {1, 86},
  {2, 87},
  {3, 88},
  {4, 89},
  {8, 90},
  {9, 91},
  {10, 92},
  };
// Create an array of CCValueLED objects that turn on/off an LED
// depending on the MIDI control change messages they receive
CCValueLED leds[] {
  {11, 85}, // led pin number, controller number
  {12, 86},
  {13, 87},
  {14, 88},
  {15, 89},
  {16, 90},
  {17, 91},
  {18, 92},  
  };

// Instantiate a CCPotentiometer object
CCPotentiometer potentiometer[] = {
  {A0,0x10},                                   // Analog pin connected to potentiometer
  {MIDI_CC::Channel_Volume, CHANNEL_1}, // Channel volume of channel 1
  {A1,0x11},
  {MIDI_CC::Channel_Volume, CHANNEL_1}, // Channel volume of channel 1
  {A2,0x12},
  {MIDI_CC::Channel_Volume, CHANNEL_1}, // Channel volume of channel 1
      };


void setup() {
  Control_Surface.begin(); // Initialize Control Surface


  int status;

  // initialize LCD with number of columns and rows: 
  // hd44780 returns a status from begin() that can be used
  // to determine if initalization failed.
  // the actual status codes are defined in <hd44780.h>
  // See the values RV_XXXX
  //
  // looking at the return status from begin() is optional
  // it is being done here to provide feedback should there be an issue
  //
  // note:
  //  begin() will automatically turn on the backlight
  //
  status = lcd1.begin(LCD_COLS, LCD_ROWS);
  status = lcd2.begin(LCD_COLS, LCD_ROWS);
  //if(status) // non zero status means it was unsuccesful

  
  {
    // hd44780 has a fatalError() routine that blinks an led if possible
    // begin() failed so blink error code using the onboard LED if possible
    //hd44780::fatalError(status); // does not return
  }

  // initalization was successful, the backlight should be on now

  // Print a message to the LCD
   lcd2.print("CHORUS    PHASER                                        DELAY 1  DELAY 2");
   lcd1.print("FLANGER  TREMOLO                                        OD     CW Filter");
}
 
void loop() {
  Control_Surface.loop(); // Update the Control Surface
}
 
There doesn't seem to be anything wrong with the code - no pin conflicts etc.
Can you post a photo which clearly shows the connections to the Teesy2? Especially pins A0,A1,A2.

Pete
 
I can post it later. So it seems to be a bad wiring or something. I think I have tried the expression pedal connection without the code for A2 and it is still working as described. So maybe I will try a rewiring only for that pin A2.
 
Hello there. Thanks again. Checked it out today. Seems that the Analog Pin is faulty. Connected it to another Analog PIN and it is working! Have a good day!
 
Status
Not open for further replies.
Back
Top