LCD Keypad Sheild with Menu


So i have done a program with the following options :

  1. Menu 1
  2. Menu 2
  3. Menu 3
  4. Menu 4
  5. Menu 5
  6. Menu 6
    Sub Menu 6(1)
    Sub Menu 6(2)
    Sub Menu 6(3)
    Sub Menu 6(4)
    Sub Menu 6(5)
    Sub Menu 6(6)

My Issue is :

I can navigate easily in the main menu, all keys work perfectly. The problem arises when i enter the submenu of 6th main menu option. None of the keys work perfectly. Sometimes i have to press them multiple times and then it works sometimes. There is some delay coming, dunno from where.

Code is attached.

It would be very helpful if someone guides me where i am going wrong or even simplify the code.
PS : I have Dfrobot keypad shield and have built a custom pcb similar to it without the FTDI chip. I flash it though ICSP pins. This code i test on keypad shield and then burn it the main board. Same problem on main board too.
Thank You

Code.ino (16.2 KB)


If you didn't already, read this (click !), it applies to your shield and your sketch.

And your problem: Dump the delays. There's much better ways to reach the same effect without the trouble you are experiencing now. There's a reason for the remarks in my signature (the text below any and all of my posts).

Wont dumping the delays introduce debouncing?

siren215: Wont dumping the delays introduce debouncing?

Oh, but that's a good thing. Now the CPU isn't crippled with delays and can start checking things and process things like it's meant to. Debouncing an input can be done easily with no noticeable impact on performance.

siren215: Wont dumping the delays introduce debouncing?

No, it won't. And neither will it introduce debouncing. There's better ways to do something with debouncing (find out what that word actually means, so you can understand how to manage the problem it addresses).

Did you check my signature ?