Arduino Mega code on Arduino Nano

First of all - Nano has three times less memory than Mega. Your code used display - so the lacking of the memory could be a problem