Arduino PWM for 12V LED Lights

I am trying to do a sunrise/sunset led light effect for my aquariums. I found the code online and it looks like it’s working very well. But the light is flickering. I tried using 2 MOSFETS(picture and description in the image below), but the light is flickering. On 1 MOSFET I am using Pin 6 and the ground pin and on the other MOSFET I am using the 5V and the same pins. Power is through another power supply and tried attaching the ground together but it still flickers. I tried using a 12V 50W Power supply which would be enough to power a 6W led light and the arduino. Any ideas what could be the problem?

That is the link of where I code the code from.