rusefi/firmware/controllers/lua/examples/dash_output_abit_m11.16txt

25 lines
1.1 KiB
Plaintext

-- sending data out for dash screens which understand Abit M11 protocol
-- for instance TDG Dashboard v2.0
--
-- See "Протокол передачи данных ADLM для контроллеров M11" for protocol description
--
ABIT_1 = 0x281
setTickRate(100)
-- Little-endian System, "Intel"
function setTwoBytesLsb(data, offset, value)
value = math.floor(value)
data[offset + 2] = value >> 8
data[offset + 1] = value & 0xff
end
out1 = { 0x1D, 0xE1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
function onTick()
rpm = getSensor("RPM")
setTwoBytesLsb(out1, 0, rpm)
txCan(1, ABIT_1, 0, out1)
end