Hyundai Repair: Cam shaft censor, camshaft position sensor, crankshaft position sensor


Question
I recently purchased a 2000 hyundai elantra and I have had nothing but problems, several codes have come up one of them that might be relevant to the question is a crankshaft sensor .Would that be causing my car to die are could it be the cam shaft .I just changed the fuel pump after a friend of mine told me that might be the problem and in good faith I changed it ,I thought he was right but no difference and im out 130 .The problem I am having is my car is constantly dieing it will run for awhile and then die then let it sit for a few and then it will start back up and its also been idling high can you help me thanks

Answer
If you're receiving a trouble code P0335 for a crankshaft position sensor, the problem is nearly certain to be in the sensor.  Without proper information from the sensor, the ECM may be unable to run the engine properly or may be unable to run the engine at all.  Often, these sensors fail when hot and then work properly again once cooled.

The camshaft position sensor will not cause a stallling issue on this vehicle.  Typically, if the ECM does not receive this signal, the engine will still run normally except for some hesitation on acceleration from a stop when cold and the same when warm but to a much lesser degree.

I'm curious as to all the trouble codes you've retrieved from the ECM.  Depending on what they are, there may be further information there regarding your issue.