Arduino Mega PWM doesn't work in C Code
Majenko showed you one of your mistakes.

Then you wrote:

//Enable to interrupt Compare Match A
TIMSK1 = (1&lt;&lt;OCIE1A);


And this is your other mistake. You should not enable an interrupt
unless you have defined an ISR for it. Otherwise your program will
restart every time the interrupt fires.