Il faut rajouter un hysteresis (demandez à wikipedia ce que c'est)
if (temp > temperature_max)
{
etat = HIGH;
}
if (temp < temperature_max)
{
etat = LOW;
}
deviendrait
if (temp > temperature_max + hyst) { // hyst est une constante, de l'ordre de 1.0 degrés
etat = HIGH;
}
if (temp < temperature_max - hyst) {
etat = LOW;
}
[code]