Nextion: Paging Trouble

I was trying to follow this. I wanted to create a sketch to test to switch pages on the nextion from the arduino.
I used the same sketch as above with the suggested changes. But, I was unsuccessful. Interesting things is that I was using a UNO and the sketch would failed. But, when I switch the board from an UNO to a Mega 2560, it compliles without error. But, the pages on the Nextion do not change.

Welcome to the Arduino fora.
Before you do anything else please read General guidance
How to use this forum
Especially item #7 on posting code.
Then post your code so we can see what you have tried.

You might also like to follow the tutorial Using Nextion displays with Arduino