et utilisez une structure et un tableau quand vous commencez à numéroter les variables...
par exemple
// Réglage de la sensibilité des boutons :
const int I0V = 587; // Input 0V : Limite haute de l'information 0V
const int I3VL = 637; // Input 3V Low : limite basse de l'information 3.3V
const int I3VH = 737; // Input 3V High : limite haute de l'information 3.3V
const int I5VL = 973; // Input 5V Low : limite basse de l'information 5V
const int I5VH = 1073; // Input 5V High : limite haute de l'information 5V
struct t_route {
const byte channelPin;
const byte busFX1Pin;
const byte busFX2Pin;
bool auRepos;
} routes[] {
{A1, 0, 1, true},
{A2, 2, 3, true},
{A3, 4, 5, true},
{A4, 6, 7, true},
{A5, 8, 9, true},
{A6, 10, 11, true},
{A7, 12, 13, true},
};
const byte nbRoutes = sizeof routes / sizeof routes[0];
void activateFX1(
void setup() {
for (byte i = 0; i < nbRoutes; i++) {
pinMode(routes[i].channelPin, INPUT);
pinMode(routes[i].busFX1Pin, OUTPUT);
pinMode(routes[i].busFX2Pin, OUTPUT);
routes[i].auRepos = analogRead(routes[i].channelPin) < I0V;
}
}
void loop() {
for (byte i = 0; i < nbRoutes; i++) {
byte etat = analogRead(routes[i].channelPin));
...
}
}
sinon pour simplifier votre gestion des boutons, éventuellement utilisez la librairie de @bricoleau ou alors la librairie OneButton de Matthias Hertel.