Well, if you're lucky, you may find some wire chafing causing the problem. Otherwise, I think the pedal assembly has to be replaced.
Throttle/Pedal Position Sensor/Switch D / E Voltage Correlation
Pedal Sensors will use SAE D,E,F codesP2139
Throttle/Pedal Position Sensor/Switch D / F Voltage Correlation
Pedal Sensors will use SAE D,E,F codesP2140
Throttle/Pedal Position Sensor/Switch E / F Voltage Correlation
Pedal Sensors will use SAE D,E,F codes
• The AP (Accelerator Pedal) is a three track pedal. The AP incorporates three potentiometers. Through out the movement of the AP the resistance values of the three potentiometers must agree. During the movement of the AP if one of the three potentiometer readings do not agree, the check engine light will illuminate and the vehicle will continue to perform as normal. If two signals from the AP are lost the PCM will allow the engine to idle only and illuminate the check engine light.
• The three-track pedal is a safety feature. The three track pedal takes the place of the Idle Validation Switch allowing for limited system failure and still maintaining performance.