Problems with Sketch on Mega 2560

I do not inspect your code, but: if you use interrupts, the UNO and the MEGA is different! There is no the same pin assignment.