What happened is the Engine Computer detected a problem, set a diagnostic fault code, and turned on the Check Engine light to tell you. It's important to not disconnect the battery or let it run dead now until that code has been read, otherwise that valuable information will be lost.
Also be aware those codes never say to replace parts or that they're bad. They only indicate the circuit or system that needs further diagnosis. Here in the U.S. Many auto parts stores will read the codes for you for free, otherwise you need a mechanic with a scanner to read them.
There are well over a thousand potential fault codes. With the least serious problems, if it's intermittent and goes away, the Check Engine light will turn off while you're driving. If it's more serious and the problem stops acting up while you're driving, the light will stay on until you stop and restart the engine. If it's even more serious but it goes away intermittently, the light will stay on every time you start the engine. When it's really serious, the light will be flashing. That's when it's important to stop the engine right away because too much raw fuel is going into the exhaust system and can overheat and damage the catalytic converter.
Also be aware there can be a diagnostic fault code set without the Check Engine light turning on at all. Only about half of the codes relate to something that could adversely affect emissions. Those are the ones that must turn the light on.
Monday, December 16th, 2013 AT 8:30 AM