Update B6-temp.md
This commit is contained in:
parent
9361fe430d
commit
6c26861de4
14
B6-temp.md
14
B6-temp.md
|
@ -65,6 +65,7 @@ totalEcuMessages = 0
|
||||||
totalTcuMessages = 0
|
totalTcuMessages = 0
|
||||||
|
|
||||||
motor1Data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
motor1Data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||||
|
canMotorInfo = { 0x00, 0x00, 0x00, 0x14, 0x1C, 0x93, 0x48, 0x14 }
|
||||||
|
|
||||||
function onMotor1(bus, id, dlc, data)
|
function onMotor1(bus, id, dlc, data)
|
||||||
rpm = getBitRange(data, 16, 16) * 0.25
|
rpm = getBitRange(data, 16, 16) * 0.25
|
||||||
|
@ -114,7 +115,12 @@ function onAnythingFromTCU(bus, id, dlc, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- VAG Motor_1 just as example
|
-- VAG Motor_1 just as example
|
||||||
canRxAdd(ECU_BUS, 0x280, onMotor1)
|
canRxAdd(ECU_BUS, MOTOR_1, onMotor1)
|
||||||
|
|
||||||
|
-- canRxAdd(ECU_BUS, MOTOR_3, printAndDrop)
|
||||||
|
-- canRxAdd(ECU_BUS, MOTOR_5, printAndDrop)
|
||||||
|
-- canRxAdd(ECU_BUS, MOTOR_6, printAndDrop)
|
||||||
|
-- canRxAdd(ECU_BUS, MOTOR_7, printAndDrop)
|
||||||
|
|
||||||
-- last option: unconditional forward of all remaining messages
|
-- last option: unconditional forward of all remaining messages
|
||||||
canRxAddMask(ECU_BUS, 0, 0, onAnythingFromECU)
|
canRxAddMask(ECU_BUS, 0, 0, onAnythingFromECU)
|
||||||
|
@ -126,6 +132,12 @@ function onTick()
|
||||||
if everySecondTimer:getElapsedSeconds() > 1 then
|
if everySecondTimer:getElapsedSeconds() > 1 then
|
||||||
everySecondTimer:reset()
|
everySecondTimer:reset()
|
||||||
print("Total from ECU " .. totalEcuMessages .. " from TCU " .. totalTcuMessages)
|
print("Total from ECU " .. totalEcuMessages .. " from TCU " .. totalTcuMessages)
|
||||||
|
|
||||||
|
|
||||||
|
canMotorInfo = (canMotorInfo + 1) % 8
|
||||||
|
canMotorInfo[1] = 0x90 + (canMotorInfo * 2)
|
||||||
|
-- txCan(1, MOTOR_INFO, 0, canMotorInfo)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue