struct {
const byte PinDet;
const byte PinLed;
} sig [] = {
{ 11, A0 },
{ 10, A1 },
};
const int N = 4;
void setup() {
for (int n = 0; n < N; n++) {
pinMode (sig [n].PinDet, INPUT_PULLUP);
pinMode (sig [n].PinLed, OUTPUT);
}
}
void loop() {
for (int n = 0; n < N; n++) {
digitalWrite (sig [n].PinLed,
digitalRead (sig [n].PinDet));
}
}