ESP32 Analog Input – analogRead

AnalogRead does indeed work on the ESP32.  Many sites and posts that claim that the Analog to Digital converter of the ESP32 doesn’t work.  I have tested analogRead using the code below and it works as expected.  The code below compiles and downloads to my ESP32 Development board and produces correct results.  The input pin is the seventh pin from the top on the left hand side of the ESP32 Development Board.

#define RLED 16
#define InPin 33

int x ;

void setup() {
   Serial.begin(115200);
   pinMode(RLED, OUTPUT);
}

void loop()
{
   digitalWrite(RLED, LOW);
   delay(100);
   x = analogRead( InPin );
   Serial.println( x );
   digitalWrite(RLED, HIGH);
   delay(100);
}

Have fun!

2 thoughts on “ESP32 Analog Input – analogRead

  1. maneco

    HI! i’m trying to make work the analog example from the downloaded codes, is analogwrite implemented? thanks!

    1. ResearchIt

      Last I’ve heard is it’s still not. I don’t understand why it’s not. It’s been an issue for a while. Right now I’m trying to find out who is supposed to be working on it so I can see what the issue seems to be.

Comments are closed.