this sketch fails
with the error
why?
If I change the first three lines to
it compiles no problem
Code:
char potPins[] = {
A10,A11,A12,A13,A16,A17
};
int potCount = 6;
int inputPot = 0;
void setup() {
for (int thisPot = 0; thisPot < potCount; thisPot++)
pinMode(potPins[thisPot], INPUT);
Serial.begin (9600);
while (!Serial) { delay(10);}
}
void loop() {
for (int thisPot = 0; thisPot < potCount; thisPot++) {
inputPot = analogRead(potPins[thisPot]);
Serial.println("potentiometer ");
Serial.println(thisPot);
Serial.println(inputPot);
delay(1000);
}
delay(3000);
}
with the error
Code:
potentiometer3:2:9: error: 'A12' was not declared in this scope
A10,A11,A12,A13,A16,A17
^~~
C:\Users\Stefan\Documents\Arduino\potentiometer3\potentiometer3.ino:2:9: note: suggested alternative: 'A11'
A10,A11,A12,A13,A16,A17
^~~
A11
potentiometer3:2:13: error: 'A13' was not declared in this scope
A10,A11,A12,A13,A16,A17
^~~
C:\Users\Stefan\Documents\Arduino\potentiometer3\potentiometer3.ino:2:13: note: suggested alternative: 'A11'
A10,A11,A12,A13,A16,A17
^~~
A11
potentiometer3:2:17: error: 'A16' was not declared in this scope
A10,A11,A12,A13,A16,A17
^~~
C:\Users\Stefan\Documents\Arduino\potentiometer3\potentiometer3.ino:2:17: note: suggested alternative: 'A11'
A10,A11,A12,A13,A16,A17
^~~
A11
potentiometer3:2:21: error: 'A17' was not declared in this scope
A10,A11,A12,A13,A16,A17
^~~
C:\Users\Stefan\Documents\Arduino\potentiometer3\potentiometer3.ino:2:21: note: suggested alternative: 'A11'
A10,A11,A12,A13,A16,A17
^~~
A11
exit status 1
'A12' was not declared in this scope
why?
If I change the first three lines to
Code:
char potPins[] = {
A0,A1,A2,A3,A6,A7
};
it compiles no problem