[photo needed] How to make a midi controller with 16 analog inputs using Teensy LC!

Hi, I'm sorry to bump this old thread, but I can't get these very nice instructions to work with a teensy 4.0 and two CD74HC4067's. Here's what I've done so far.

Since I use 2 muxes, I've copy/pasted the code of oddson, which has a different mapping then OP's andrewslobford's.

Andrew:
//mapping of mux to teensy digital pins
int pin_Out_S0 = 4;
int pin_Out_S1 = 3;
int pin_Out_S2 = 2;
int pin_Out_S3 = 1;
int pin_In_Mux1 = A0;

Oddsond's:
//mapping of mux to teensy digital pins
int pin_Out_S0 = 0;
int pin_Out_S1 = 1;
int pin_Out_S2 = 2;
int pin_Out_S3 = 3;
int pin_In_Mux1 = A1;
int pin_In_Mux2 = A2;

I believe the digital ins are in the same spot on the 4 as on the lc, but tried both configs/codes and changed the wiring on my breadboard accordingly. When I open up Ableton Live, the teensy is recognized (Teensymidi), but when I assign the controller to a parameter, it seems any knob I use on my prototype sends this array: '70,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36' from the code, instead of just one cc.

Anyone has any thoughts on what could be wrong or perhaps is the wiring for a 4 different then for a lc and am I wrong in assuming it's the same perhaps?
 
I can't say what might be wrong, but I can at least answer that the pins on Teensy LC and Teensy 4.0 work the same way regarding use of 74HC4067 analog mux.

If you're using code similar to msg #1, which still has the serialPringMIDIdata() function, I'd recommend opening the Arduino Serial Monitor so you can see the more detailed info about what's really happening. Trying to troubleshoot and guess what really happened based on which MIDI messages arrive is much hardware than just reading the text that tells you what really happened.

If even that isn't enough, please understand we can't see how you've connected the hardware and can't know exactly what modifications you've made to the code (sometimes small details matter) so helping involves pretty much blind guesswork. You could get better help if we're able to see what you've done. If you show photos of your hardware, make sure to get camera angles where we can see how the wires really connect. Seeing a screenshot or actual copy of the printed messages from the serial monitor also might give some clues.
 
Thanks Paul for your reply. And indeed, I should have added some pictures the first time.

So here's my breadboard setup for the code with 2 muxes (but I left one mux out on the board just to make the wiring a bit more clear):
2muxIMG_2425.jpg 2muxIMG_2426.jpg 2muxIMG_2424.jpg

And here are pictures of the setup for the code by the OP, including a picture of the hex data:
origIMG_2427.jpgorigIMG_2428.jpgorigIMG_2429.jpghexdata.jpg

After turning the knob on the breadboard there is still some data popping up on the serial monitor, so that is also not looking like that should be happening.

I've tried both configurations with 3.3 and 5 volt, but that doesn't make a difference. I hope the pictures give some insight in how the wiring is setup.
 
haha. Spotted a massive oversight already. Didn't connect the +'s and -'s correctly to the power rails when bridging from one side to the other :rolleyes:
Didn't fix the issue, but it wouldn't have worked that way either.
 
Looks like you have the type of breadboard where the power rails are split into 2 separate sides. You'll need to add wires to join them here.

power.jpg

Also looks like Teensy's pins might not be pressed into the breadboard. It can be a really tight fit on cheaper breadboards. Try to press on the pins and not the center of the PCB.

gap.jpg
 
sorry for the very late reply Paul. The Teensy was doing okay, although the pins could go deeper into the breadboard. It probably wasn't working because the headers on the multiplexers weren't making contact with the muxes themselves. Because, after soldering the headers on the muxes everything works as it should. Thanks for the help!
 
Back
Top