Buttons, Switch, and TS inputs not working with Teensy 3.6

Status
Not open for further replies.
Alright, simple buttons, a switch, and a TS input. At one point in my testing they worked just fine with the breadboard and the Teensy 2.0. One wire going to Digital Inputs (0,1,2,3), one to ground. The switch works when I test it again. The buttons and TS input however do not work correctly. They will send a signal through the Serial Monitor when I touch and "untouch" the alligator clip to the solder lugs. But when I connect the clip and press the button it doesn't send that signal like it should. I've included the code that I am using for them. Like I said the switch works but the buttons or sustain pedal don't. Any ideas on if it could be my physical buttons having a problem or if it is something in my code which is essentially the same for each?

Code:
#include <Bounce.h>

// Create Bounce objects for each button. The Bounce object
// automatically deals with contact chatter or "bounce", and
// it makes detecting changes very simple.
// (#, ##) ## = debounce time
Bounce button0 = Bounce(0, 10); // panic button
Bounce button1 = Bounce(1, 10); // switch for snares
Bounce button2 = Bounce(2, 10); // next patch button
Bounce button3 = Bounce(3, 10); // sustain pedal

// the MIDI channel number to send messages
const int channel = 1;

/////////////////////
////// SET UP ///////
/////////////////////

void setup() {
Serial.begin(9600);
pinMode(0, INPUT_PULLUP);
pinMode(1, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
}

////// LOOP /////
void loop() {

///// BUTTONS /////
button0.update();
button1.update();
button2.update();
button3.update();

/// ON ///
if (button0.fallingEdge()) {
usbMIDI.sendNoteOn(0, 127, channel);
Serial.println("Panic!!!");
}
if (button1.fallingEdge()) {
usbMIDI.sendNoteOn(1, 127, channel);
Serial.println("Switch!!!");
}
if (button2.fallingEdge()) {
usbMIDI.sendNoteOn(2, 127, channel);
Serial.println("Next!!!");
}
if (button3.fallingEdge()) {
usbMIDI.sendControlChange(64, 127, channel);
Serial.println("Sustain!!!");
}

/// OFF ///
if (button0.risingEdge()) {
usbMIDI.sendNoteOff(0, 0, channel);
Serial.println("Panic Off!!!");
}
if (button1.risingEdge()) {
usbMIDI.sendNoteOff(1, 0, channel);
Serial.println("Switch Off!!!");
}
if (button2.risingEdge()) {
usbMIDI.sendNoteOff(2, 0, channel);
Serial.println("Next Off!!!");
}
if (button3.risingEdge()) {
usbMIDI.sendControlChange(64, 0, channel);
Serial.println("Sustain Off!!!");
}
}

51146908_10219319577439957_5969420357168267264_n.jpg63B5A220-EE56-4671-B12A-7414970D9773.jpgIMG_4388.jpgIMG_4390.jpg
 
There doesn't appear to be any solder in the ground pin on the T3.6 (to the left of the black wire) and the ground side of the two red buttons are both gray wires that disappear somewhere. Have you connected the grounds to the T3.6 somewhere?
A circuit diagram might help.

Pete
 
All of the gray wires in the pictures are the many ground wires for the project. They all go together in the 2nd picture and come out with 1 wire. They are connected next to the black wire. I think the picture just doesn't show very well. I can try to fritz together a circuit diagram.

IMG_4408.jpg
 
Fritzing doesn't have a 3.6, but this is the basic wiring. First time trying this out. Hope it works and helps.

L ---> R
TRS Input, T 3.6, TS Input, Rocker Switch, 2 buttons

Screen Shot 2019-02-11 at 7.00.19 PM.png
 
Let's focus on one button for now - the one with the black wire that goes to digital pin 0.
Run the sketch in message #1.
Connect a short piece of wire directly from the ground side of the button to the T3.6 ground pin and push the button.
The program should print Panic!!!
If it does, the problem is most likely in the connection from the button's ground to where all the grounds meet.
If it doesn't, then either the button is dead or the connection at either end of the black wire is bad.

Do you have a multimeter?

Pete
 
AYYY!!! We've got lift-off. Just need to redo those grounds in the mass connect. haha. Both buttons, switch, and TS input worked bypassing the mass connect ground. Thank you for that idea. Not sure WHY ON EARTH I didn't think of it. haha. Thank you!

I do have a multimeter.
 
Got done redoing the ground connections for those and chose to set those apart from the rest of the grounds coming in so I now have 2 ground wires going to the Teensy. Tested it again and all of them worked.
 
Status
Not open for further replies.
Back
Top