local meshRes = vec2(1024,1024) --change the resolution of the texture here
local rightButtonCoords = vec2(27, 287) --grab from obj inspector
local rightButtonSize = vec2(211, 273) --grab from obj inspector
local leftButtonCoords = vec2(277, 299) --grab from obj inspector
local leftButtonSize = vec2(195, 268) --grab from obj inspector
local displayMesh = display.interactiveMesh{ mesh = "int_rebic3_at", resolution = meshRes}
local btnRight = displayMesh.clicked(rightButtonCoords,rightButtonSize)
local btnLeft = displayMesh.clicked(leftButtonCoords,leftButtonSize)
local psiTable = {0.8,0.9,1.0,1.2,1.3,1.5}
local iterator = 4

function boostPsiToPercentage(psi) --converting psi into 0..1 values
   return psi/1.5
end

      ac.setTurboWastegate(boostPsiToPercentage(psiTable[iterator]))
function update(dt)
   ac.log(car.turboWastegates[1])
   
   if btnRight() then
         ac.setTurboWastegate(boostPsiToPercentage(psiTable[iterator]))   
         iterator = math.min(6,iterator + 1) --wont go above 6
   elseif btnLeft() then
         ac.setTurboWastegate(boostPsiToPercentage(psiTable[iterator]))
         iterator = math.max(1,iterator - 1) --won't go below 1
   end
end