ADC channel selection

rbrakhya
Posts: 8
Joined: Sat May 08, 2021 10:09 am

ADC channel selection

Postby rbrakhya » Sun Jul 04, 2021 9:11 pm

I´ve been struggling to change the ADC channel on an ESP32-C3.

I get an ADC value, but only from GPIO0 no matter what i set in analogread() it always reads GPIO0.
I tried two boards to rule out physical damage. Any ideas what can be wrong?


Image

Is there somthing whong in my code? Tried the minimal code to isolate the problem.

Code: Select all

void setup() {
Serial.begin(115200);
pinMode(0, INPUT_PULLUP);
pinMode(1, INPUT_PULLUP);

}

void loop() {
  Serial.print("Batt=");
  delay(5);
   Serial.print(analogRead(0));
   delay(5);
     Serial.print("  Solar=");
    delay(5);
   Serial.println(analogRead(1));
   delay(185);
}
Did try without the pinMode without any success.

Who is online

Users browsing this forum: No registered users and 38 guests