Étape 3: Température - TMP36
int tempPin = 2 ; Broche de données TMP36
void setup()
{
Serial.Begin(9600) ; programme d’installation de série
}
void loop()
{
lecture int = analogRead(tempPin) ; lire l’entrée pin
flotteur de tension = lecture * 5,0 ;
tension / = 1024.0 ;
Serial.Print(voltage) ;
Serial.println (« volts ») ;
float temperatureC = (tension - 0.5) * 100 ;
Serial.Print(temperatureC) ;
Serial.println ("degrés C") ;
float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0 ;
Serial.Print(temperatureF) ;
Serial.println ("degrés F") ;
Delay(500) ;
}