dtmf decoding

#define IRQ_PIN  2   
#define D0_PIN   3   // Recieve the data port binary 0
#define D1_PIN   4   // Recieve the data port binary 1
#define D2_PIN   5   // Recieve the data port binary 2
#define D3_PIN   6   // Recieve the data port binary 3


byte irq_state;

void setup()
{
// Configura El Puerto Serial 9600,8,N,1
Serial.begin(9600);

// puts the port in Reading
pinMode(IRQ_PIN, INPUT);
pinMode(D0_PIN, INPUT);
pinMode(D1_PIN, INPUT);
pinMode(D2_PIN, INPUT);
pinMode(D3_PIN, INPUT);
  
}

void loop()
{
// wait for the signal or tone
irq_state = digitalRead(IRQ_PIN);

if ( irq_state == 1 )
   {

     Serial.print("Key : ");
     char key = read_codigo(); // Read the dtmf code
     Serial.println(key); // The key recieved prints
     delay(80);          // pause to synchronize the signal / IRQ

   }
}
/*-------------------------------------------------------------*/
byte read_codigo()
{
byte dato;           // Variable that have the byte value of the key
char key;            // Variable that have the key xter


byte D0,D1,D2,D3;    // Variable read state

// read the logic state variableMT8870 (1 o 0 , ON o OFF )
D0 = digitalRead(D0_PIN);
D1 = digitalRead(D1_PIN);
D2 = digitalRead(D2_PIN);
D3 = digitalRead(D3_PIN);

// Cconverts binary to BYTE or Integer
// Writes the bits in a variable data
bitWrite(data,0,D0);
bitWrite(data,1,D1);
bitWrite(data,2,D2);
bitWrite(data,3,D3);

// Turn the key to CHAR
if ( data == 1  ) key = '1';
if ( data == 2  ) key = '2';
if ( data == 3  ) key = '3';
if ( data == 4  ) key = '4';
if ( data == 5  ) key = '5';
if ( data == 6  ) key = '6';
if ( data == 7  ) key = '7';
if ( data == 8  ) key = '8';
if ( data == 9  ) key = '9';

if ( data == 10 ) key = '0';
if ( data == 11 ) key = '*';
if ( data == 12 ) key = '#';
if ( data == 13 ) key = 'A';
if ( data == 14 ) key = 'B';
if ( data == 15 ) key = 'C';
if ( data == 0  ) key = 'D';

return key;

}

/*-------------------------------------------------------------*/
/*-------------------------------------------------------------*/