Welcome to JustAnswer, I'm Neal and I am here to assist you. Please feel free to ask follow up questions, it is part of the process.
That may be your TPS, here is some info. But first try disconnecting the batteries for 10 minutes and see if that resets it. It might start working and you can get it to your mechanic.
ACCELERATOR PEDAL POSITION SENSOR (APPS)-ECM INPUTThe Accelerator Pedal Position Sensor (APPS) is a linear potentiometer. It provides the Engine Control Module (ECM) with a DC voltage signal proportional to the angle, or position of the accelerator pedal. In previous model years, this part was known as the Throttle Position Sensor (TPS).Diesel engines used in previous model years used a mechanical cable between the accelerator pedal and the TPS lever. Linkage and bellcranks between the TPS cable lever and the fuel injection pump were also used. Although the cable has been retained with the APPS, the linkage and bellcranks between the cable lever and the fuel injection pump are no longer used.
The APPS assembly is located at the top-left-front of the engine. A plastic cover is used to cover the assembly. The actual sensor is located behind its mounting bracket.The APPS is serviced (replaced) as one assembly including the lever, brackets and sensor. The APPS is calibrated and permanently positioned to its mounting bracket.CAUTION: Do not attempt to remove sensor from its mounting bracket as electronic calibration will be destroyed (sensor-to-bracket mounting screws are permanently attached). Two accelerator lever set screws are used to position lever. Do not attempt to alter positions of these set screws as electronic calibration will be destroyed.