Esp32 adc in micropython

analog = ADC(Pin(32), atten=ADC.ATTN_11DB)

Is this command still required with a new Esp32-c6? I want to read a sensor that outputs up to 5 volts. I have made a voltage divider so it outputs 0 to 3.3 v.

Yes, the voltage divider is the right approach. Since your ESP32-C6 ADC input is limited, bringing the sensor output down to 0–3.3 V is important. I’d still set the ADC attenuation if your MicroPython build supports it, and use read_uv() for a more accurate voltage reading.