Hi I have a problem my Atmega328p A6 and A7 pins are not working i have a large project for wich i need all analog inputs but if i try to read analog input A6 or A7 i get an error: "A6 was not declared in scope".
Thanks in advance for any help.
This is just a very simple version to test the analog pin A6 to show you i havent done anything wrong in the code.
int x = 0;
const int pin = A6;
void setup() {
Serial.begin(9600);
pinMode(pin, INPUT);
}
void loop() {
x = analogRead(pin);
Serial.println(x);
}
The UNO will not support that, the Nano will. You need to be sure the proper board is selected in tools. If yours is not there contact the manufacturer or retailer for the appropriated module for your IDE. You could try a Nano, there are two bootloaders and I will guess it will be the old one that will work.
Okay i have set it to Arduino Nano and now it is compiling fine.
But when uploading i get an error that says this:
Sketch uses 1870 bytes (6%) of program storage space. Maximum is 30720 bytes.
Global variables use 188 bytes (9%) of dynamic memory, leaving 1860 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x8e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x8e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x8e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x8e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x8e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x8e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x8e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x8e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x8e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x8e
Failed uploading: uploading error: exit status 1