CEL Problem

Hey Guys, I got a question, what would make my car idle like it has a Cam. I will sit still and it will start to idle really low and acts like it wants to die. :nonono:

At night the lights will dim with the beat of the idle. :shrug:

CEL comes on periodiclly while driving then goes off and may come on again. :shrug:

Any help will be appreciated