Outputs not changing instantly.

Can somebody tell my why my outputs do not change instantly as I press the input switch at pin 1/2/3 please?.

I.E. if i have pressed button one, it starts the cycling of the LED on and off. However if I press the input switch at pin 2, it does not change instantly. Is there a way around this?, or am I doing this completely wrong?.

Any help would be greatly appreciated.

const int buttonPin[7] = {0, 1, 2, 3, 4, 5, 6};     // the number of the pushbutton pin
const int ledPin[7] = {7, 8, 9, 10, 11, 12, 13};      // the number of the LED pin

int buttonState = 0;         // variable for reading the pushbutton status

 void setup() {
   pinMode(0, INPUT);      // set the switch pin to be an input
   pinMode(1, INPUT);
   pinMode(2, INPUT);
   pinMode(3, INPUT);
   pinMode(4, INPUT);
   pinMode(5, INPUT);
   pinMode(6, INPUT);
   pinMode(7, OUTPUT);    // Sets the output pins
   pinMode(8, OUTPUT);
   pinMode(9, OUTPUT);
   pinMode(10, OUTPUT);  
   pinMode(11, OUTPUT);
   pinMode(12, OUTPUT);
   pinMode(13, OUTPUT);   
 }


 void loop() {
   
   
   if (digitalRead(1) == HIGH) {
     // if the switch is closed:
     digitalWrite(0, LOW);
     digitalWrite(2, LOW);
     digitalWrite(3, LOW);
     digitalWrite(4, HIGH);
     digitalWrite(5, LOW);
     digitalWrite(6, LOW);
     digitalWrite(7, LOW);    // turn on LED
     digitalWrite(8, HIGH);     // turn off all other LED's
     digitalWrite(9, LOW);
     digitalWrite(10, LOW);
     digitalWrite(11, LOW);
     digitalWrite(12, LOW);
     digitalWrite(13, LOW);  
   }
   if (digitalRead(2) == HIGH) {
     // if the switch is closed:
     digitalWrite(0, LOW);
     digitalWrite(1, LOW);
     digitalWrite(3, LOW);
     digitalWrite(4, LOW);
     digitalWrite(5, HIGH);
     digitalWrite(6, LOW);
     digitalWrite(7, LOW);    // turn on LED
     digitalWrite(8, LOW);     // turn off all other LED's
     digitalWrite(9, HIGH);
     digitalWrite(10, LOW);
     digitalWrite(11, LOW);
     digitalWrite(12, LOW);
     digitalWrite(13, LOW);  
   }
   if (digitalRead(3) == HIGH) {
     // if the switch is closed:
     digitalWrite(0, LOW);
     digitalWrite(1, LOW);
     digitalWrite(2, LOW);
     digitalWrite(4, LOW);
     digitalWrite(5, LOW);
     digitalWrite(6, HIGH);
     digitalWrite(7, LOW);    // turn on LED
     digitalWrite(8, LOW);     // turn off all other LED's
     digitalWrite(9, LOW);
     digitalWrite(10, HIGH);
     digitalWrite(11, LOW);
     digitalWrite(12, LOW);
     digitalWrite(13, LOW);  
   }
   if (digitalRead(4) == HIGH) {
     digitalWrite(0, LOW);
     digitalWrite(2, LOW);
     digitalWrite(3, LOW);
     digitalWrite(5, LOW);
     digitalWrite(6, LOW);
     digitalWrite(7, LOW);
     digitalWrite(8, HIGH);
     digitalWrite(9, LOW);    
     digitalWrite(10, LOW);
     digitalWrite(12, LOW);
     digitalWrite(13, LOW);
     digitalWrite(11, LOW);
     delay(30000);
     digitalWrite(11, HIGH);
     delay(500);
   }
   if (digitalRead(5) == HIGH) {
     digitalWrite(0, LOW);
     digitalWrite(2, LOW);
     digitalWrite(3, LOW);
     digitalWrite(5, LOW);
     digitalWrite(6, LOW);
     digitalWrite(7, LOW);
     digitalWrite(8, LOW);
     digitalWrite(9, HIGH);    
     digitalWrite(10, LOW);
     digitalWrite(13, LOW);
     digitalWrite(11, LOW);
     digitalWrite(12, LOW);
     delay(10000);
     digitalWrite(12, HIGH);
     delay(500);
     
   }
   if (digitalRead(6) == HIGH) {
     digitalWrite(0, LOW);
     digitalWrite(2, LOW);
     digitalWrite(3, LOW);
     digitalWrite(5, LOW);
     digitalWrite(6, LOW);
     digitalWrite(7, LOW);
     digitalWrite(8, LOW);
     digitalWrite(9, LOW);    
     digitalWrite(10, HIGH);
     digitalWrite(12, LOW);
     digitalWrite(11, LOW);
     digitalWrite(13, LOW);
     delay(10000);
     digitalWrite(13, HIGH);
     delay(500);
     
   }
 }

This statement and the several more like it in your code:

delay(30000);

Means go to sleep and don't do anything for 30 senconds. Don't check button states. Don't change any outputs. Don't do anything for 30 senconds.

Look at the blink without delay example that came with the IDE and try to understand how that is working. The code doesn't stop and hold while the light is on. It keeps on looping and checking to see if it is time to turn it off or not. In the meantime buttons are still being polled and all the rest of the code can keep running thousands of times per second.

Sunflower666: Can somebody tell my why my outputs do not change instantly as I press the input switch at pin 1/2/3 please?.

I.E. if i have pressed button one, it starts the cycling of the LED on and off. However if I press the input switch at pin 2, it does not change instantly. Is there a way around this?, or am I doing this completely wrong?.

Any help would be greatly appreciated.

When you do the delay, it is not going to read any buttons until the delay is finished. So if you press button 4, it will wait 30 seconds until it reads the next button.

What you need to do is read and take time to understand the blink without delay example code, and adapt it to multiple buttons. For a lot of folk, it is a hard concept to learn. I think that this is a failing of the Arduino software, in that they should have had a standard framework for scheduling work to do at a time period, instead people have to write their own software (or find somebody else's work), IMHO, the delay function is a crutch unless you have only a single action, and don't have to worry about multiple events.

You also need to keep track of the state of the buttons, and only do the action when the state changes from low to high (or possibly high to low). Essentially what you need to do is make a state machine of what to do at what time period