
local M = {}

local function onInit()
  electrics.values.odyssey18_spadie_gear_P = 0
  electrics.values.odyssey18_spadie_gear_R = 0
  electrics.values.odyssey18_spadie_gear_N = 0
  electrics.values.odyssey18_spadie_gear_D = 0
  electrics.values.odyssey18_spadie_gear_S = 0
end

local function updateGFX(dt)
  electrics.values.odyssey18_spadie_gear_P = (electrics.values.gear_A <= 0) or 0
  electrics.values.odyssey18_spadie_gear_R = (electrics.values.gear_A <= 0.1 and electrics.values.gear_A >  0.0) or 0
  electrics.values.odyssey18_spadie_gear_N = (electrics.values.gear_A <= 0.2 and electrics.values.gear_A >= 0.1) or 0
  electrics.values.odyssey18_spadie_gear_D = (electrics.values.gear_A <= 0.3 and electrics.values.gear_A >= 0.2) or 0
  electrics.values.odyssey18_spadie_gear_S = (electrics.values.gear_A <= 0.4 and electrics.values.gear_A >= 0.3) or 0
end

-- public interface
M.onInit = onInit
M.onReset = onInit
M.updateGFX = updateGFX

return M