merci fdufnews et aux autres
tu m'a bien avancé
cela a l"air de fonctionner, et en utilisant milli() je risque un overflow au bout de combien de temps ?
voici le code que j'ai entré
int ledPin=11;
boolean ledState=0;
#define Temp_Low 60
#define Temp_High 240
int interval=0;
unsigned long previousMillis;
void setup(){
pinMode(ledPin, OUTPUT);
ledState = 0;
}
void loop(){
unsigned long currentMillis = millis()/1000;
if(currentMillis - previousMillis > interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState == LOW){
ledState = HIGH;
interval = Temp_Low;
}else{
ledState = LOW;
interval = Temp_High;
}
// set the LED with the ledState of the variable:
digitalWrite(ledPin, ledState);
}
}