I am new to Arduino and enjoying the experience. I am trying to set the analogReadResolution() of a Due to 12 bit as explained in this tutorial http://arduino.cc/en/Reference/AnalogReadResolution but get the following error:
In function 'void loop()':
sketch_jul28a:9: error: 'analogReadResolution' was not declared in this scope
I have tried both software versions 1.0.5 and 1.5.2, the board is correctly set to Due and I have been able to successfully use the board at normal 10 bit resolution in other tutorials. The code is as follows, any help or guidance appreciated:
void setup() {
// open a serial connection
Serial.begin(9600);
}
void loop() {
// read the input on A0 at default resolution (10 bits)
// and send it out the serial connection
analogReadResolution(10);
Serial.print("ADC 10-bit (default) : ");
Serial.print(analogRead(A0));
// change the resolution to 12 bits and read A0
analogReadResolution(12);
Serial.print(", 12-bit : ");
Serial.print(analogRead(A0));
// change the resolution to 16 bits and read A0
analogReadResolution(16);
Serial.print(", 16-bit : ");
Serial.print(analogRead(A0));
// change the resolution to 8 bits and read A0
analogReadResolution(8 );
Serial.print(", 8-bit : ");
Serial.println(analogRead(A0));
// a little delay to not hog serial monitor
delay(100);
}