What it is: The LM35 is an analog temperature sensor that outputs a voltage directly proportional to temperature: exactly 10 mV per °C (so 250 mV = 25 °C). No library or calibration needed.
How it works: You read the output pin with the ESP32's ADC and divide the millivolts by 10 to get °C. This sketch uses analogReadMilliVolts(), which applies the ESP32's factory ADC calibration for a far more accurate voltage than raw analogRead().
Wiring (chip flat side facing you, pins down — left to right):
LM35 +Vs (left) -> 3V3
LM35 Vout (middle) -> GPIO0
LM35 GND (right) -> GND
OLED VCC=3V3, GND=GND, SDA=GPIO4, SCL=GPIO5
Libraries: only "Adafruit SSD1306" and "Adafruit GFX Library" (no sensor library needed).
On screen / Serial: temperature in °C with one decimal, updated a few times a second.
Gotchas: The plain LM35 can't read below 0 °C without a negative supply. GPIO0 is a strapping/boot pin on the ESP32-C3 — it's fine to read at runtime, but don't hold it low while resetting. Keep the wire short to reduce noise; average a few samples if the value jitters.