Trouble reading from AD6 and AD7, Arduino Mini

Hello all,

I've designed a project around an Arduino Mini, that uses the additional ADC pins AD4-AD7. I'm having trouble reading from AD6 and AD7. I've verified that the connections are OK to the board (checked continuity with a multimeter) so it doesn't seem to be a hardware issue.

I've initialized AD6 and AD7 as inputs using pinMode (20 and 21, respectively) and the compiler seems cool with that.

The code also seems to do an analogRead just fine on the pins, but I can't get serial.println to spit out the value that was read - it crashes the arduino! So, I suppose I'm not really sure if analogRead really worked or not.

So is there anything special I need to be doing to get these ADC lines to work? Without serial.println working, how can I verify that the analogRead is happening (and get a specific value?)

Thanks for your help...

I’ve initialized AD6 and AD7 as inputs using pinMode (20 and 21, respectively) and the compiler seems cool with that.

The pinMode command does not return an error code if you specify an invalid pin. The compiler does not care if you specify an invalid pin.

That the compiler is cool with that is completely irrelevant in determining whether the pinMode command does anything when the input is pin 20 or pin 21.

Serial.print() should not crash the Arduino. If it does, there is something wrong with your code. Let’s take a quick peak.

Oh. We can’t do that. Your shoulder is in the way. Can you lean over a little bit.

That’s not helping. Maybe a little farther. Careful, don’t fall out of the chair.

Rats, still can’t see anything.

Ah, sorry about that. I was at work when I posted my question, so I didn't have access to my code.

But GUESS WHAT?? (Yes, I really am excited enough to shout!) I figured it out. Purely by accident, I changed the pin assignment to "22" on one of my analog lines. It started producing an output! How strange is that?? It would appear that AD6 is pin 22, and AD7 is pin 23.

So, it's working now. Thanks for your help, though! Pass it on to anyone who's asking...

int AD6 = 22;
int AD7 = 23;