Search code examples
arduinoadc

How to turn on all ADC's in Arduino


I am working on Arduino UNO. I am stuck at a point where I need to turn on the ADC pins on it. Please help me out, I am new to Arduino.


Solution

  • by default the A0-5 pins are HiZ input and ready to sample their A2D's. You need to simply sample them whenever you want.

    ...
    int sensorValue0 = analogRead(A0);
    int sensorValue1 = analogRead(A1);
    int sensorValue2 = analogRead(A2);
    int sensorValue3 = analogRead(A3);
    int sensorValue4 = analogRead(A4);
    int sensorValue5 = analogRead(A5);
    ...