Emtron: Difference between revisions

No edit summary
Line 3: Line 3:


==Configuration==
==Configuration==
This script integrates the Emtron ECU with RaceCapture/Pro telemetry.
This script integrates the Emtron ECU with RaceCapture/Pro telemetry, using the factory standard CAN bus mapping


==Baud Rate==
==Baud Rate==
Line 11: Line 11:
===TPS===
===TPS===
* CAN ID: 1251
* CAN ID: 1251
* Bytes: 5,6
* Bytes: 1,2
* Scaling: 0 = -100.0% ; 2000 = 100.0%
* Scaling: 0 = -100.0% ; 2000 = 100.0%


==Lua Script==
==Lua Script==
Line 26: Line 25:
--handle TPS message data
--handle TPS message data
function process_tps(data)
function process_tps(data)
     local tps = data[5] * 256 + data[6]
     local tps = data[1] * 256 + data[2]
     tps = (tps - 1000) / 10
     tps = (tps - 1000) / 10
     setChannel(tps_id, tps)
     setChannel(tps_id, tps)

Revision as of 16:41, 5 February 2015

Emtron ECU

Emtron KV8.jpg

Configuration

This script integrates the Emtron ECU with RaceCapture/Pro telemetry, using the factory standard CAN bus mapping

Baud Rate

Baud Rate is:

Channels

TPS

  • CAN ID: 1251
  • Bytes: 1,2
  • Scaling: 0 = -100.0% ; 2000 = 100.0%

Lua Script


setTickRate(30) --30Hz

--set up virtual channels
tps_id = addChannel("TPS", 10, 1)

--handle TPS message data
function process_tps(data)
    local tps = data[1] * 256 + data[2]
    tps = (tps - 1000) / 10
    setChannel(tps_id, tps)
end

function onTick()
    repeat --will drain CAN buffer on each tick
        id, e, data = rxCAN(0)
        if id == 1251 then process_tps(data) end
    until id == nil
end