/* Program 2-11 Control LEDs using push-button switches. */ const int LED[] = {5, 9, 10}; const int SW[] = {3, 4, 7}; void setup() { /* configure input output pins for switches and LEDs */ for (int i = 0; i < 3; i++) { pinMode(LED[i], OUTPUT); pinMode(SW[i], INPUT); } } void loop() { /* read switches and use the values to set LEDs */ for (int i = 0; i < 3; i++) { digitalWrite(LED[i], digitalRead(SW[i])); } }