Salut ,
y aurait-il une jolie facon de " concatener " ces 2 fonctions proprement svp ?
j ' y arrive pas ![]()
void activeRelaisTable (byte startPin , byte endPin ) {
for ( byte i = startPin; i < endPin; i++ ) {
tableau_Etat_Relais [ i ] = LOW; //on affiche le nouvel état du relais
digitalWrite ( tableau_Pin_Relais [ i ] , LOW ); //on effectue la mise à jour du pin
if ( i < RELAY_NUMBER_V ) gestionnaireDeTache.registerAsyncCommand( i, TIMER_V, resetTimer );
else if ( i >= RELAY_NUMBER_V && i < RELAY_NUMBER_A ) gestionnaireDeTache.registerAsyncCommand( i, TIMER_A, resetTimer );
else if (i >= RELAY_NUMBER_A ) {}
}
}
et
void activeRelais (byte i ) {
tableau_Etat_Relais[i] = !tableau_Etat_Relais[i]; //on affiche le nouvel état du relais
digitalWrite(tableau_Pin_Relais[i], tableau_Etat_Relais[i]); //on effectue la mise à jour du pin
if ( i < RELAY_NUMBER_V ) gestionnaireDeTache.registerAsyncCommand( i, TIMER_V, resetTimer );
else if ( i >= RELAY_NUMBER_V && i < RELAY_NUMBER_A ) gestionnaireDeTache.registerAsyncCommand( i, TIMER_A, resetTimer );
else if (i >= RELAY_NUMBER_A ) {}
}