#define LM35_PIN A0 // Pin analógico del ESP32
void setup() {
Serial.begin(9600);
}
void loop() {
float lectura = analogRead(LM35_PIN);
//(ESP32 usa 3.3V como referencia)
float voltaje = lectura * (3.3 / 4095.0); // Convertir a voltaje
float temperatura = voltaje / 0.1; // Conversion según ecuación LM35
Serial.print("Temperatura: ");
Serial.print(temperatura);
Serial.println(" °C");
delay(1000);
}