Reducing LED flickering
No schematic or code so this answer is a little generic, though the same question can be encountered with completely different code and schematic.

As John U. suggested, see if you can increase the PWM frequency or possibly use a different algorithm.  This stackoverflow post suggests an approach.  Trade-offs can be made between levels of brightness and period.  

If this doesn't reduce the flicker enough, try adding an RC filter between the PWM output and the MOSFET gate to smooth the waveform.