<?xml version="1.0" encoding="utf-8"?>
<!--
RealDash OBD2 description file optimised for
Audi TT Mk2 2007 2.0 TFSI MED9.1 (DSG / FWD) - highly modified
Requires RealDash 1.5.8 or newer
-->
<OBD2>
  <init>
    <command send="atd"></command>
    <command send="atz"></command>
    <command send="atat1"></command>
    <command send="atst62"></command>
    <command send="atsp0"></command>
    <command send="ate0"></command>
    <command send="atl0"></command>
    <command send="ats0"></command>
    <command send="ath1"></command>
    <command send="atdpn"></command>
    <command send="0100"></command>
    <command send="0120"></command>
  </init>

  <rotation>
    <!-- ========== HIGH PRIORITY (boost critical) ========== -->
    <command send="010c" skipCount="0" targetId="37" conversion="V/4" keepInRotation="true"></command> <!-- RPM -->
    <command send="010b" skipCount="0" targetId="31" keepInRotation="true"></command> <!-- MAP (kPa) -->
    <command send="0110" skipCount="0" targetId="30" conversion="V/100" keepInRotation="true"></command> <!-- MAF g/s -->
    <command send="0104" skipCount="1" targetId="100" conversion="V/2.55" keepInRotation="true"></command> <!-- Engine Load % -->
    <command send="010d" skipCount="0" targetId="81" units="km/h"></command> <!-- Vehicle Speed -->

    <!-- ========== LAMBDA / AFR (high priority for modified car) ========== -->
    <!-- Narrowband voltage -->
    <command send="0114" skipCount="1" targetId="0" conversion="B0/200" keepInRotation="true"></command> <!-- O2 B1S1 Voltage -->
    <command send="0115" skipCount="2" targetId="0" conversion="B0/200"></command> <!-- O2 B1S2 Voltage -->
    
    <!-- Wideband equivalence ratio (best for AFR) -->
    <command send="0124" skipCount="1" targetId="0" conversion="(B0*256+B1)/32768" keepInRotation="true"></command> <!-- Lambda B1S1 (EQ Ratio) -->
    <command send="0125" skipCount="2" targetId="0" conversion="(B0*256+B1)/32768"></command> <!-- Lambda B1S2 -->
    
    <!-- Alternative wideband format some MED9.1 reply with -->
    <command send="0134" skipCount="2" targetId="0" conversion="(B0*256+B1)/32768"></command> <!-- Lambda B1S1 alt -->
    <command send="0135" skipCount="3" targetId="0" conversion="(B0*256+B1)/32768"></command> <!-- Lambda B1S2 alt -->

    <!-- ========== CORE ENGINE ========== -->
    <command send="0111" skipCount="2" targetId="42" conversion="V/2.55"></command> <!-- Throttle Position % -->
    <command send="010e" skipCount="3" targetId="38" conversion="V/2-64"></command> <!-- Timing Advance -->
    <command send="0105" skipCount="12" targetId="14" units="C" conversion="V-40"></command> <!-- Coolant Temp -->
    <command send="010f" skipCount="6" targetId="27" units="C" conversion="V-40"></command> <!-- Intake Air Temp -->
    <command send="0133" skipCount="15" targetId="11"></command> <!-- Barometric Pressure -->
    <command send="015c" skipCount="20" targetId="152" units="C" conversion="V-40"></command> <!-- Oil Temp -->

    <!-- ========== FUEL / TRIMS ========== -->
    <command send="0106" skipCount="5" targetId="17" conversion="V/1.28-100"></command> <!-- STFT Bank 1 -->
    <command send="0107" skipCount="12" targetId="102" conversion="V/1.28-100"></command> <!-- LTFT Bank 1 -->
    <command send="0108" skipCount="5" targetId="18" conversion="V/1.28-100"></command> <!-- STFT Bank 2 -->
    <command send="0109" skipCount="12" targetId="104" conversion="V/1.28-100"></command> <!-- LTFT Bank 2 -->
    <command send="010a" skipCount="12" targetId="202" conversion="V*3"></command> <!-- Fuel Pressure -->
    <command send="012f" skipCount="25" targetId="170" conversion="V/2.55"></command> <!-- Fuel Level % -->

    <!-- ========== OTHER USEFUL ========== -->
    <command send="011f" skipCount="8" targetId="33"></command> <!-- Engine Runtime -->
    <command send="0146" skipCount="30" targetId="173" units="C" conversion="V-40"></command> <!-- Ambient Air Temp -->
    <command send="atrv" skipCount="4" targetId="12"></command> <!-- Battery Voltage -->
  </rotation>
</OBD2>