Factory pedal and sensor do not get just a sensor at a parts store - around $450 dealer installed and they reset the computer trust me I went down your road this was the only fix.
Had the same problem with my 2003 Denali, dealer said they would have to replace the entire "module" for around $928, plus four hours labor. I called a sunroof repair shop and they said to hold down the "close" button for 10 seconds and it would re-set itself. It worked perfectly. Never going back to that dealer again!
Problem may be with the level sending unit, which is part of the fuel pump assembly in the fuel tank. You can check this with a good code reader that will give you live data from this unit and compare it with what the gauge is saying. If they don't match, you can try a good quality fuel system cleaner to see if that solves the problem. If they do match, then the problem is probably still in your instrument panel (IP) or engine computer.
Your vehicle has electronic throttle control . Position sensor's in the gas pedal an the throttle body , inputs to the Throttle Actuator Control Module
The TAC module is the control center for the throttle actuator control system. The TAC system is self-diagnosing and provides diagnostic information to the PCM through a dedicated serial data line. The TAC achieves throttle positioning by providing a pulse width modulated voltage to the TAC as directed by the PCM.
The throttle actuator control (TAC) system delivers improved throttle response and greater reliability and eliminates the need for mechanical cable. The TAC system performs the following functions:
• Accelerator pedal position sensing
• Throttle positioning to meet driver and engine demands
• Throttle position sensing
• Internal diagnostics
• Cruise control functions
• Manage TAC electrical power consumption
The TAC system components include the following:
• The accelerator pedal position (APP) sensors
• The throttle body assembly
• The throttle actuator control module
• The powertrain control module (PCM)
Accelerator Pedal Position (APP) Sensor
The accelerator pedal assembly contains 2 individual APP sensors within the assembly. The accelerator pedal position (APP) sensors 1 and 2 potentiometer type sensors each with 3 circuits:
• A 5-volt reference circuit
• A low reference circuit
• A signal circuit
The APP sensors are used to determine the pedal angle. The control module provides each APP sensor a 5-volt reference circuit and a low reference circuit. The APP sensors then provide the control module with signal voltage proportional to pedal movement. APP sensor 1 signal voltage is low at the rest position and increases as the accelerator pedal is applied. APP sensor 2 signal voltage is high at the rest position and decreases as the accelerator is applied.
Throttle Body Assembly
The throttle body assembly consists of the throttle body, the throttle position (TP) sensors, and the throttle actuator motor. The throttle body functions similar to a similar to a conventional throttle body with the following exceptions:
• An electric motor opens and closes the throttle valve.
• The throttle blade is spring loaded in both directions and the default position is slightly open.
• There are 2 individual TP sensors within the throttle body assembly.
The TP sensors 1 and 2 are potentiometer type sensors each with 3 circuits:
• A 5-volt reference circuit
• A low reference circuit
• A signal circuit
The TP sensors are used to determine the throttle plate angle. The control module provides each TP sensor a 5-volt reference circuit and a low reference circuit. The TP sensors then provide the control module with signal voltage proportional to throttle plate movement. Both TP sensor signal voltages are low at closed throttle and increase as the throttle opens.
Flickering light's could be caused by a bad diode in the alternator . Fluctuating idle could be caused same alternator problem or dirty throttle plate.
Throttle Body Cleaning To Restore Idle Quality
Vacuum modulator is probably bad. A sticking shift solenoid inside the transmission will do it too. A bad transmission control module will cause it too. Your mechanic wasn't thorough enough when he checked the transmission.
#1 in the picture is electrical connector for canister purge solenoid. It has a two wire connector. One wire is pink, the other is dark green with a white tracer. Just to add, I looked at info for a 5.3L engine.