Setting a pin High or Low from serial input from dtmf shield

Hello, I have downloaded this sketch below, it runs perfect. My DTMF shield is connected to pins 3-7.
I would like to control output pins from the number I get from the DTMF shield. Any input would be appreciated.
Thank You

void setup() {
  Serial.begin(9600);
  pinMode(3, INPUT);
  pinMode(4, INPUT);
  pinMode(5, INPUT);
  pinMode(6, INPUT);
  pinMode(7, INPUT);
}

void loop() {
  uint8_t number;
  bool signal ;  
  signal = digitalRead(3);
  if(signal == HIGH)	/* If new pin pressed */
   {
    delay(250);
    number = ( 0x00 | (digitalRead(7)<<0) | (digitalRead(6)<<1) | (digitalRead(5)<<2) | (digitalRead(4)<<3) );
      switch (number)
      {
        case 0x01:
        Serial.println("Pin Pressed : 1");
        break;
        case 0x02:
        Serial.println("Pin Pressed : 2");
        break;
        case 0x03:
        Serial.println("Pin Pressed : 3");
        break;
        case 0x04:
        Serial.println("Pin Pressed : 4");
        break;
        case 0x05:
        Serial.println("Pin Pressed : 5");
        break;
        case 0x06:
        Serial.println("Pin Pressed : 6");
        break;
        case 7:
        Serial.println("Pin Pressed : 7");
        break;
        case 0x08:
        Serial.println("Pin Pressed : 8");
        break;
        case 0x09:
        Serial.println("Pin Pressed : 9");
        break;
        case 0x0A:
        Serial.println("Pin Pressed : 0");
        break;
        case 0x0B:
        Serial.println("Pin Pressed : *");
        break;
        case 0x0C:
        Serial.println("Pin Pressed : #");
        break;   
      
  
  
        
     
      
      }
  }
}

I do not get it.

(1)

    delay(250);
    number = ( 0x00 | (digitalRead(7)<<0) | (digitalRead(6)<<1) | (digitalRead(5)<<2) | (digitalRead(4)<<3) );

Why waste the power of the Arduino for 1/4 second with delay(250) ? Why bother with the 0x00 term? Why bother shifting by 0?

(2)

There is a switch/case statement that looks at all of the reasonable choices on a DTMF keypad. What more than putting

digitalWrite(pinNumber, pinState) ;

in the correct place is needed?

The 250 delay keeps from getting multiple digits with one key press of the dtmf generator.

So, you don't really want to know that a key is pressed, you want to know when a key goes from unpressed to pressed (becomes pressed). There is an example that covers this. I am away from my computer or I would tell you the exact name.

Thanks vaj4088, I added "digitalWrite(pinNumber, pinState) ;" in the code and does exactly want I wanted. I may like to ad other feature soon. How this works, if 1 is pressed it turns on an output, if 2 is pressed it turns off the output, and so on.

I am glad that I could help.

Eventually, you should look at the example

**File ** | **Examples ** | 02.Digital | StateChangeDetection