DFrobot analog microphone not working on arduino mega

I am using the DFrobot analog microphone sensor (DFR0034). Analog_Sound_Sensor_SKU__DFR0034-DFRobot

One minute the sensor was working fine the next it was just giving me 1023 (max value). I moved from my mega to my uno and it worked like magic. I moved it back to my mega and it did not work. I moved it back to my uno and it did not work.

Does anyone know what is happening?