problema con unir dos sketch en arduino mega 2560

Try to join two sketch the keyboard example and blink without delay the latter as a function that I call A (), to try to do a multitasking, but it does not work inside the IF, if I only put it if it works, how to do so Work within the IF, thank you very much. I hope someone helps me, due to the little knowledge in programming, this is the code:

#include <Keypad.h>

const int ledPin = 15; // the number of the LED pin

// Variables will change :
int ledState = LOW; // ledState used to set the LED

// Generally, you should use “unsigned long” for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0; // will store last time LED was updated

// constants won’t change :
const long interval = 1000; // interval at which to blink (milliseconds)

int st;
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{ 1, 5, 9, 13},
{ 2, 6, 10, 14},
{ 3, 7, 11, 15},
{ 4, 8, 12, 16},
};
/* {‘0’,‘1’,‘2’,‘3’},
{‘4’,‘5’,‘6’,‘7’},
{‘8’,‘9’,‘A’,‘B’},
{‘C’,‘D’,‘E’,‘F’}
};*/
byte rowPins[ROWS] = {38, 40, 42, 44};//connect to the row pinouts of the keypad
byte colPins[COLS] = {46, 48, 50, 52}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

void a() {
// here is where you’d put code that needs to be running all the time.

// check to see if it’s time to blink the LED; that is, if the
// difference between the current time and last time you blinked
// the LED is bigger than the interval at which you want to
// blink the LED.
unsigned long currentMillis = millis();

if (currentMillis - previousMillis >= interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;

// if the LED is off turn it on and vice-versa:
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}

// set the LED with the ledState of the variable:
digitalWrite(ledPin, ledState);
}
}
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}

void loop() {
char customKey = customKeypad.getKey();

if (customKey) {//!= NO_KEY){
st = customKey;
Serial.print(“tecla:”);
Serial.print(customKey);
Serial.print("");
Serial.print("tecla: ");
Serial.println(st);
a();
}
}