KEYPAD not function

i am using keypad model AK-1604-N-BBW. when i upload the code below, my keypad not function. how to operate this?

:confused:

i tried to upload the same coding but without sms coding, the keypad just work fine. but with the coding below, keypad is not working.

please help.

i am using keypad model AK-1604-N-BBW.

Exact;y one of us knows what that means. Hopefully, you'll be along soon to answer the question.

Or, you could post a link.

how to operate this?

Wire it correctly. Write the correct code. If you need help you'll post a link to the keypad, an explanation of how you determined which pins are row pins and which pins are column pins, AND say something about what the code ACTUALLY does and how that differs from what you want. "It don't work" doesn't mean squat here.

Hello,

The problem is all the delay()s in the SMS code.

I wrote the keypad library using a polling method. That means for best keypad performance your loop() should run more than 100 times per second. At the bottom of your loop(), below the SMS code, you have:

    sendATcommand("AT+CMGD=1,4", "OK", 1000);
    delay(200);
  }
  delay(1000);  <------- First big problem
}

That delay(1000) means that the keypad.getKey() is only called once each second. That is so slow that you need to keep your finger on the button for more than a second before the keypress is recognized.

Also, all the delays in the SMS code will prevent the keypad from running for another 4.5 seconds every time you receive an SMS message.

You need to rewrite your sketch so that it does not use any delay()s if possible.

Have you looked at the File->Examples->02.Digital->BlinkWithoutDelay example sketch?

I suggest to use a delay of 5-10 ms.

Hope that would work ....

OK. Sorry for this short reply but it looks like your next problem is with your while loops. You need to make sure that you always exit the while()'s and return to loop() so getKey() is called. Your biggest problem is this:

while (answer == 0);   // Waits for the asnwer with time out

Once your code reaches this point it will never leave. You are in an infinite while loop.

Edit: Sorry. Wrong answer. After looking some more it looks like you get stuck at:

        while (answer == 1)
        {
            x = 0;
            memset(SMS, '\0', 100);
            answer = 0;
            while (Serial.available() == 0);   <------ You're wasting a lot of time here doing nothing.