question:
habituellement j ecris un compteur non bloquant de cette façon (sans declarer quoi que ce soit)
'timer etape g1=20
tempsattente=1000
if g1<>20 then timerattente=timer+tempsattente
if g1=20 and timer>timerattente then
attente=1
else
attente=0
endif
je tente en laguage arduino
void loop()
{
int tempsattente;
int timerattente;
int g1;
tempsattente=1000;
if (g1<>20)
{
timerattente=timer()+tempsattente;
}
if (g1=20 && timer()>timerattente)
{
attente=1;
else //???
attente=0;
}
} //fin loop
ça marcherait ça?