# Change the resolution of analogRead in Arduino

ArduinoArduino BoardsArduino IDEArduino Programming Language

By default, the analogRead in Arduino follows a 10-bit resolution (this may be different for different boards). However, sometimes, you may not need such a high resolution. Often, people wish to set the resolution to 8-bits, to save on storage. This is because an 8-bit value will take just one byte of storage, whereas anything above that will take two bytes of storage.

Luckily, Arduino has an inbuilt function to change the resolution of the analog to digital conversion. The function is analogReadResolution() and it takes in the argument as the resolution in bits.

So, if you wish to set an 8-bit resolution, you can run analogReadResolution(8). An example implementation is given below −

## Example

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
}