int TMP36Pin = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
int rawValue = analogRead(TMP36Pin);
float voltage = rawValue * (5.0 / 1023.0);
float temperatureC = (voltage - 0.5) * 100.0;
Serial.print("Temperature: ");
Serial.print(temperatureC);
delay(1000);
}
Copyright ⓒ TECH79 All right reserved