midi out on 6 CC's

Hello all,
I have had a good look around the internet at code and descriptions and had a good tinker with my simple circuit, but am having a very strange basic problem with the following sketch found at http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1165833586 (the description in the link will explain the use of the sketch better than I could)

The code all seems to make sense to me, but for some reason which ever of the pins I hook up to the variable resistor ends up controlling the value of all 6 midi CC’s. I hope that makes sense to who ever might read this and that someone spots a common mistake I should look out for in my wiring/adapting the sketch.

Thanks in advance for any help anyone may be able to offer,

Can you post a schematic of how you hooked the potentiometers up ?

They sholud be hooked up with 5V and ground on the two outside tabs and the middle tab going to the analog pin.

You should try to isolate the problem to either the reading / conversion of the analog inputs, or to the sending of the MIDI data.

Try to send MIDI data for all 6 CC’s without reading the potentiometers. If this works you can asume that that part of the code is ok.

Then try to read the 6 potentiometers and just display the values you read to verify that you have 6 individually working potentiometers. You should be able to read values between 0 and 1023 individually on all 6 potentiometers.

Hello and thanks very much for the help
I have successfully sent midi CCs out, so the last part of the code is fine, I’m afraid I don’t know how to monitor the inputs of the 6 analog pins, that’s why I went looking for someone else’s code!
I’m actually using LDRs instead of knob type variable resisters, so they only have 2 legs. Nevertheless; I was sure I had them wired correctly. Here is a drawing of how I have them wired up (no I am not 2 years old!)

I thought this would distribute the 5 volts in parallel, yet each time I plug in an LDR to the breadboard, the CC value (on all 6 CCs) drops, this is the least of my worries though.
As I wave my hand over them, the midi CCs do change, so information is all flowing fine, just not split up into 6.
Any help much appreciated, gig is tomorrow!!!

You can’t hook up the LDR’s that way. They must be hooked up as voltage dividers. It’s not very complicated, you just need one fixed resistor for each LDR.

Check this site :

Scroll down a bit to the part about hooking ann LDR up to Arduino

Thanks very much for your help, it is now working as it should and the gig will be great!

It was indeed just in need of those fixed resistors you pointed out, so thanks again.