Applying more then 3.3V on the Due’s pins will damage the SAM3X chip. The analogReference() function is ignored on the Due.
![]() |
| Analog input pins on Arduino Due Board |
Example to read from Analog Input:
int analogInputA0 = A0;
int varA0;
void setup() {
Serial.begin(9600);
analogReadResolution(12); //set ADC resolution to 12 bits
}
void loop() {
varA0 = analogRead(analogInputA0); //read ADC input
Serial.println(varA0, HEX); //print as HEX
delay(1000);
}
![]() |
| Read Analog Input on Arduino Due |
If the code compiled with error: 'analogReadResolution' was not declared in this scope.
Check if you select the correct Tools -> Board.


Getting this error while compiling the above code:
ReplyDeletesketch_apr17a.ino: In function 'void setup()':
sketch_apr17a.ino:6:26: error: 'analogReadResolution' was not declared in this scope
Error compiling.
Please help..
Check if you select the correct board.
DeletePlease check my updated in the post.