I've been doing that since last night, I've checked all the wiring (actually I'm just using two led's for testing purposes. One led is connected to pin 2 (which is HIGH) and one to pin 8 (LOW) and one to analog pin 2 (or pin 16) (LOW) and pin 2 won't work. I've changed the pins, the wires, the led's, the breadboard, everything...
By the way, I'm using an atmega8 on a Arduino NG.
Logically it shoud work, but it doesnt. I've been doing it for long enough so it can't be a wiring problem.
And if I state for example that an analog pin 2 is HIGH/OUTPUT with port register (PORTC = B00000100, DDRC = B00000100) and use another pin as ground, it will work no problem, but if I make a for statement where my pinArray is int pinArray ={14, 15, 16, 17, 18, 19}, it will not work. However if my pinArray is pinArray = {8, 9, 10, 11, 12}, it will work with no problem.
My for statement looks like this:
for (count=0;count<6;count++) {
pinMode(pinArray[count], OUTPUT);
delay(timer2);
pinMode(pinArray[count], OUTPUT);
delay(timer2);
pinMode(pinArray[count], INPUT);
delay(timer2);
}
and it works fine (It's a copy from Knight rider example) with pins 8-13, not with analog pins 0-5
strange